1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-04-27 22:57:45 +00:00

only allow area aoe actions through the aoe handler

This commit is contained in:
NotAdam 2019-02-11 19:10:42 +11:00
parent 8e74681db1
commit 29f1f9b6bc

View file

@ -22,9 +22,17 @@ void World::Manager::ActionMgr::handleAoEPlayerAction( Entity::Player& player, u
{
player.sendDebug( "got aoe act: {0}", actionData->name );
auto action = Action::make_Action( player.getAsPlayer(), actionId, actionData, framework() );
action->setPos( pos );
if( !actionData->targetArea )
{
// not an action that has an aoe, cancel it
action->castInterrupt();
return;
}
bootstrapAction( player, action, *actionData );
}
@ -33,6 +41,13 @@ void World::Manager::ActionMgr::handleTargetedPlayerAction( Entity::Player& play
{
auto action = Action::make_Action( player.getAsPlayer(), actionId, actionData, framework() );
// cancel any aoe actions casted with this packet
if( actionData->targetArea )
{
action->castInterrupt();
return;
}
if( targetId != player.getId() )
{
auto target = player.lookupTargetById( targetId );
@ -126,6 +141,9 @@ bool World::Manager::ActionMgr::canPlayerUseAction( Entity::Player& player,
return false;
}
// validate range
auto& actionCost = currentAction.getCostArray();
for( uint8_t i = 0; i < actionCost.size(); ++i )
{