diff --git a/src/game/Entities/CharacterHandler.cpp b/src/game/Entities/CharacterHandler.cpp index 5ac88cbaae..46ff90cc3c 100644 --- a/src/game/Entities/CharacterHandler.cpp +++ b/src/game/Entities/CharacterHandler.cpp @@ -995,6 +995,9 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder* holder) void WorldSession::HandlePlayerReconnect() { + // Detect if reconnecting in combat + const bool inCombat = _player->IsInCombat(); + // stop logout timer if need LogoutRequest(0); @@ -1139,6 +1142,10 @@ void WorldSession::HandlePlayerReconnect() // Undo flags and states set by logout if present: _player->SetStunnedByLogout(false); + // Mark self for unit flags update to ensure re-application of combat flag at own client + if (inCombat) + _player->ForceValuesUpdateAtIndex(UNIT_FIELD_FLAGS); + m_playerLoading = false; } @@ -1395,4 +1402,4 @@ void WorldSession::HandleSetPlayerDeclinedNamesOpcode(WorldPacket& recv_data) SendPacket(data, true); sWorld.InvalidatePlayerDataToAllClient(guid); -} \ No newline at end of file +} diff --git a/src/game/Entities/Object.cpp b/src/game/Entities/Object.cpp index 33c150b650..624af9809e 100644 --- a/src/game/Entities/Object.cpp +++ b/src/game/Entities/Object.cpp @@ -578,6 +578,13 @@ void Object::BuildValuesUpdate(uint8 updatetype, ByteBuffer* data, UpdateMask* u value &= ~UNIT_FLAG_TAXI_FLIGHT; } + // On login/reconnect: delay combat state application at client UI to not interfere with secure frames init + if (target == this && (value & UNIT_FLAG_IN_COMBAT)) + { + if (static_cast(this)->GetSession()->PlayerLoading()) + value &= ~UNIT_FLAG_IN_COMBAT; + } + *data << value; } // Hide lootable animation for unallowed players @@ -3251,4 +3258,4 @@ bool WorldObject::CheckAndIncreaseCastCounter() ++m_castCounter; return true; -} \ No newline at end of file +}