mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-24 16:10:14 +00:00
game: fix player phantom model on SMSG_DESTROY_OBJECT
handleDestroyObject invoked creatureDespawnCallback_ and gameObjectDespawnCallback_ but not playerDespawnCallback_ for PLAYER entities. This caused the CharacterRenderer instance for nearby players to remain alive after they received a DESTROY_OBJECT packet (e.g. when they teleported or went out of range via server-forced despawn), leaving phantom models in the world. Mirror the same despawn logic used for out-of-range removal: call playerDespawnCallback_ and clean up the per-player bookkeeping maps so the renderer cleans up the character instance correctly.
This commit is contained in:
parent
ea9c7e68e7
commit
1e53369869
1 changed files with 8 additions and 0 deletions
|
|
@ -8399,6 +8399,14 @@ void GameHandler::handleDestroyObject(network::Packet& packet) {
|
|||
if (entity) {
|
||||
if (entity->getType() == ObjectType::UNIT && creatureDespawnCallback_) {
|
||||
creatureDespawnCallback_(data.guid);
|
||||
} else if (entity->getType() == ObjectType::PLAYER && playerDespawnCallback_) {
|
||||
// Player entities also need renderer cleanup on DESTROY_OBJECT, not just out-of-range.
|
||||
playerDespawnCallback_(data.guid);
|
||||
otherPlayerVisibleItemEntries_.erase(data.guid);
|
||||
otherPlayerVisibleDirty_.erase(data.guid);
|
||||
otherPlayerMoveTimeMs_.erase(data.guid);
|
||||
inspectedPlayerItemEntries_.erase(data.guid);
|
||||
pendingAutoInspect_.erase(data.guid);
|
||||
} else if (entity->getType() == ObjectType::GAMEOBJECT && gameObjectDespawnCallback_) {
|
||||
gameObjectDespawnCallback_(data.guid);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue