diff options
Diffstat (limited to 'src/game/Level2.cpp')
| -rw-r--r-- | src/game/Level2.cpp | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/src/game/Level2.cpp b/src/game/Level2.cpp index ed4527dcc5b..bd09c69af08 100644 --- a/src/game/Level2.cpp +++ b/src/game/Level2.cpp @@ -638,13 +638,10 @@ bool ChatHandler::HandleGameObjectTurnCommand(const char* args) o = chr->GetOrientation(); } - Map* map = obj->GetMap(); - map->Remove(obj,false); - obj->Relocate(obj->GetPositionX(), obj->GetPositionY(), obj->GetPositionZ(), o); obj->UpdateRotationFields(); - - map->Add(obj); + obj->DestroyForNearbyPlayers(); + ObjectAccessor::UpdateObjectVisibility(obj); obj->SaveToDB(); obj->Refresh(); @@ -686,13 +683,9 @@ bool ChatHandler::HandleGameObjectMoveCommand(const char* args) if (!px) { Player *chr = m_session->GetPlayer(); - - Map* map = obj->GetMap(); - map->Remove(obj,false); - obj->Relocate(chr->GetPositionX(), chr->GetPositionY(), chr->GetPositionZ(), obj->GetOrientation()); - - map->Add(obj); + obj->DestroyForNearbyPlayers(); + ObjectAccessor::UpdateObjectVisibility(obj); } else { @@ -710,12 +703,9 @@ bool ChatHandler::HandleGameObjectMoveCommand(const char* args) return false; } - Map* map = obj->GetMap(); - map->Remove(obj,false); - obj->Relocate(x, y, z, obj->GetOrientation()); - - map->Add(obj); + obj->DestroyForNearbyPlayers(); + ObjectAccessor::UpdateObjectVisibility(obj); } obj->SaveToDB(); |
