From 8387f00381a0cc3e056f9308c8e626dbf5ace047 Mon Sep 17 00:00:00 2001 From: collett Date: Wed, 12 Jun 2024 08:45:43 +0900 Subject: [PATCH] Revert "let global effect counter starts at 1 so the first status in each zone is not ignored by the client" real problem is global seq field shifted --- src/common/Network/PacketDef/Zone/ServerZoneDef.h | 2 +- src/world/Actor/Chara.cpp | 1 + src/world/Territory/Territory.cpp | 6 ++---- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/common/Network/PacketDef/Zone/ServerZoneDef.h b/src/common/Network/PacketDef/Zone/ServerZoneDef.h index 87aec5cd..1dc26c87 100644 --- a/src/common/Network/PacketDef/Zone/ServerZoneDef.h +++ b/src/common/Network/PacketDef/Zone/ServerZoneDef.h @@ -443,8 +443,8 @@ namespace Sapphire::Network::Packets::Server */ struct FFXIVIpcEffectResult : FFXIVIpcBasePacket< EffectResult > { - uint32_t globalSequence; uint32_t unknown1; + uint32_t globalSequence; uint32_t actor_id; uint32_t current_hp; uint32_t max_hp; diff --git a/src/world/Actor/Chara.cpp b/src/world/Actor/Chara.cpp index bd3d8271..a06ecdb1 100644 --- a/src/world/Actor/Chara.cpp +++ b/src/world/Actor/Chara.cpp @@ -535,6 +535,7 @@ void Sapphire::Entity::Chara::addStatusEffect( StatusEffect::StatusEffectPtr pEf auto statusEffectAdd = makeZonePacket< FFXIVIpcEffectResult >( getId() ); + statusEffectAdd->data().unknown1 = 1; statusEffectAdd->data().globalSequence = getCurrentTerritory()->getNextEffectSequence(); statusEffectAdd->data().actor_id = pEffect->getTargetActorId(); statusEffectAdd->data().current_hp = getHp(); diff --git a/src/world/Territory/Territory.cpp b/src/world/Territory/Territory.cpp index 2454e4cb..c7fdb724 100644 --- a/src/world/Territory/Territory.cpp +++ b/src/world/Territory/Territory.cpp @@ -62,8 +62,7 @@ Sapphire::Territory::Territory() : m_weatherOverride( Weather::None ), m_lastMobUpdate( 0 ), m_nextEObjId( 0x400D0000 ), - m_nextActorId( 0x500D0000 ), - m_effectCounter( 1 ) + m_nextActorId( 0x500D0000 ) { } @@ -73,8 +72,7 @@ Sapphire::Territory::Territory( uint16_t territoryTypeId, uint32_t guId, m_nextEObjId( 0x400D0000 ), m_nextActorId( 0x500D0000 ), m_lastUpdate( 0 ), - m_lastActivityTime( Util::getTimeMs() ), - m_effectCounter( 1 ) + m_lastActivityTime( Util::getTimeMs() ) { auto& exdData = Common::Service< Data::ExdDataGenerated >::ref(); m_guId = guId;