Skip to content

Commit

Permalink
Maintarget logic improved in AOE packet generation
Browse files Browse the repository at this point in the history
  • Loading branch information
SapphireMordred committed Jan 6, 2025
1 parent 1eb202f commit beeae1b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/world/Action/ActionResultBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,11 @@ std::shared_ptr< FFXIVPacketBase > ActionResultBuilder::createActionResultPacket

if( targetCount > 1 || actionData->data().EffectType != Common::CastType::SingleTarget ) // use AoeEffect packets
{
auto actionResult = makeEffectPacket( m_sourceChara->getId(), 0, m_actionId );
// todo: maintarget logic is lackluster. There needs to be some criteria for when a main target is required.
uint32_t mainTarget = Common::INVALID_GAME_OBJECT_ID;
if( !targetList.empty() )
mainTarget = targetList[ 0 ]->getId();
auto actionResult = makeEffectPacket( m_sourceChara->getId(), mainTarget, m_actionId );
actionResult->setRotation( Common::Util::floatToUInt16Rot( m_sourceChara->getRot() ) );
actionResult->setRequestId( m_requestId );
actionResult->setResultId( m_resultId );
Expand Down

0 comments on commit beeae1b

Please sign in to comment.