diff --git a/src/game/Entities/CharacterHandler.cpp b/src/game/Entities/CharacterHandler.cpp index 7d6f505b8fb..372730941b4 100644 --- a/src/game/Entities/CharacterHandler.cpp +++ b/src/game/Entities/CharacterHandler.cpp @@ -1101,6 +1101,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); @@ -1240,6 +1243,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; } diff --git a/src/game/Entities/Object.cpp b/src/game/Entities/Object.cpp index 2e7c5e6c5db..3e3915a66c0 100644 --- a/src/game/Entities/Object.cpp +++ b/src/game/Entities/Object.cpp @@ -670,6 +670,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 special-info for non empathy-casters,