mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-28 15:17:46 +00:00
set target correctly on action objs
This commit is contained in:
parent
f202a8820e
commit
a5aaa1b792
2 changed files with 17 additions and 6 deletions
|
@ -548,7 +548,7 @@ namespace Sapphire::Common
|
|||
Status = 32,
|
||||
PLDGauge = 41,
|
||||
RDMGaugeBoth = 74,
|
||||
// RDMGaugeBlack = 75, // not right?
|
||||
// RDMGaugeBlack = 75, // not right?
|
||||
DRGGauge3Eyes = 76,
|
||||
};
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
#include "Action/Action.h"
|
||||
#include "Script/ScriptMgr.h"
|
||||
|
||||
#include "Actor/Player.h"
|
||||
|
||||
#include <Exd/ExdDataGenerated.h>
|
||||
|
@ -36,6 +35,17 @@ void World::Manager::ActionMgr::handleTargetedPlayerAction( Entity::Player& play
|
|||
|
||||
auto action = Action::make_Action( player.getAsPlayer(), actionId, actionData, framework() );
|
||||
|
||||
if( targetId != player.getId() )
|
||||
{
|
||||
auto target = player.lookupTargetById( targetId );
|
||||
if( auto chara = target->getAsChara() )
|
||||
action->setTargetChara( chara );
|
||||
}
|
||||
else
|
||||
{
|
||||
// maybe an eobj? wat do?
|
||||
}
|
||||
|
||||
bootstrapAction( player, action, *actionData );
|
||||
}
|
||||
|
||||
|
@ -112,10 +122,11 @@ bool World::Manager::ActionMgr::canPlayerUseAction( Entity::Player& player,
|
|||
return false;
|
||||
}
|
||||
|
||||
// todo: min tp
|
||||
// todo: min mp
|
||||
|
||||
// todo: script callback for action conditionals?
|
||||
auto& actionCost = currentAction.getCostArray();
|
||||
for( uint8_t i = 0; i < actionCost.size(); ++i )
|
||||
{
|
||||
// todo: validate costs/conditionals here
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue