From 29f1f9b6bcc564154b6b8df4ba588b49f1b8d23e Mon Sep 17 00:00:00 2001 From: NotAdam Date: Mon, 11 Feb 2019 19:10:42 +1100 Subject: [PATCH] only allow area aoe actions through the aoe handler --- src/world/Manager/ActionMgr.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/world/Manager/ActionMgr.cpp b/src/world/Manager/ActionMgr.cpp index 5b23cb67..c8576bbf 100644 --- a/src/world/Manager/ActionMgr.cpp +++ b/src/world/Manager/ActionMgr.cpp @@ -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 ) {