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

fix a crash where m_pTarget was invalid

This commit is contained in:
NotAdam 2019-02-09 15:45:02 +11:00
parent 370261591e
commit d53fd384e3
2 changed files with 3 additions and 3 deletions

View file

@ -127,14 +127,14 @@ void Sapphire::Action::Action::onStart()
{
m_pSource->getAsPlayer()->sendDebug( "onStart()" );
auto castPacket = makeZonePacket< FFXIVIpcActorCast >( getId() );
auto castPacket = makeZonePacket< Server::FFXIVIpcActorCast >( getId() );
castPacket->data().action_id = m_id;
castPacket->data().skillType = Common::SkillType::Normal;
castPacket->data().unknown_1 = m_id;
// This is used for the cast bar above the target bar of the caster.
castPacket->data().cast_time = m_castTime / 1000.f;
castPacket->data().target_id = m_pTarget->getId();
castPacket->data().target_id = m_targetId;
m_pSource->sendToInRangeSet( castPacket, true );
m_pSource->getAsPlayer()->setStateFlag( PlayerStateFlag::Casting );

View file

@ -27,7 +27,7 @@ void World::Manager::ActionMgr::handleTargetedPlayerAction( Entity::Player& play
{
player.sendDebug( "got act: {0}", actionData->name );
auto action = Action::make_Action( player.getAsPlayer(), nullptr, actionId, actionData, framework() );
auto action = Action::make_Action( player.getAsPlayer(), actionId, actionData, framework() );
action->setType( static_cast< Common::ActionType >( type ) );
bootstrapAction( player, action, *actionData );