diff options
| author | Shauren <shauren.trinity@gmail.com> | 2015-06-07 00:09:08 +0200 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2015-06-07 00:09:08 +0200 |
| commit | 7eb25f1af6b74d3559b541d45da6cce50e657ba4 (patch) | |
| tree | 1b77ec9228cc118e0fb784db869015a41c0240ac /src/server/scripts | |
| parent | e702d60e0d2ed6e90ed0bb9675f7ee7435fe409b (diff) | |
Core/Commands: Fixed .gobject move and turn
Diffstat (limited to 'src/server/scripts')
| -rw-r--r-- | src/server/scripts/Commands/cs_gobject.cpp | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/src/server/scripts/Commands/cs_gobject.cpp b/src/server/scripts/Commands/cs_gobject.cpp index 1af687aef08..ad877bdefb4 100644 --- a/src/server/scripts/Commands/cs_gobject.cpp +++ b/src/server/scripts/Commands/cs_gobject.cpp @@ -433,14 +433,14 @@ public: } object->Relocate(object->GetPositionX(), object->GetPositionY(), object->GetPositionZ(), o); + object->RelocateStationaryPosition(object->GetPositionX(), object->GetPositionY(), object->GetPositionZ(), o); object->UpdateRotationFields(); object->DestroyForNearbyPlayers(); object->UpdateObjectVisibility(); object->SaveToDB(); - object->Refresh(); - handler->PSendSysMessage(LANG_COMMAND_TURNOBJMESSAGE, object->GetGUID().GetCounter(), object->GetGOInfo()->name.c_str(), object->GetGUID().ToString().c_str(), o); + handler->PSendSysMessage(LANG_COMMAND_TURNOBJMESSAGE, object->GetSpawnId(), object->GetGOInfo()->name.c_str(), object->GetGUID().ToString().c_str(), o); return true; } @@ -474,21 +474,20 @@ public: char* toY = strtok(NULL, " "); char* toZ = strtok(NULL, " "); + float x, y, z; if (!toX) { Player* player = handler->GetSession()->GetPlayer(); - object->Relocate(player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), object->GetOrientation()); - object->DestroyForNearbyPlayers(); - object->UpdateObjectVisibility(); + player->GetPosition(x, y, z); } else { if (!toY || !toZ) return false; - float x = (float)atof(toX); - float y = (float)atof(toY); - float z = (float)atof(toZ); + x = (float)atof(toX); + y = (float)atof(toY); + z = (float)atof(toZ); if (!MapManager::IsValidMapCoord(object->GetMapId(), x, y, z)) { @@ -496,16 +495,15 @@ public: handler->SetSentErrorMessage(true); return false; } - - object->Relocate(x, y, z, object->GetOrientation()); - object->DestroyForNearbyPlayers(); - object->UpdateObjectVisibility(); } + object->DestroyForNearbyPlayers(); + object->RelocateStationaryPosition(x, y, z, object->GetOrientation()); + object->GetMap()->GameObjectRelocation(object, x, y, z, object->GetOrientation()); + object->SaveToDB(); - object->Refresh(); - handler->PSendSysMessage(LANG_COMMAND_MOVEOBJMESSAGE, object->GetGUID().GetCounter(), object->GetGOInfo()->name.c_str(), object->GetGUID().ToString().c_str()); + handler->PSendSysMessage(LANG_COMMAND_MOVEOBJMESSAGE, object->GetSpawnId(), object->GetGOInfo()->name.c_str(), object->GetGUID().ToString().c_str()); return true; } |
