mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Core/Commands: Fixed .gobject move and turn
(cherry picked from commit7eb25f1af6) Closes #3802 Closes #15598 (cherry picked from commite68ff4186e) # Conflicts: # src/server/game/Entities/GameObject/GameObject.h # src/server/scripts/Commands/cs_gobject.cpp
This commit is contained in:
@@ -411,16 +411,23 @@ public:
|
||||
oz = player->GetOrientation();
|
||||
}
|
||||
|
||||
object->Relocate(object->GetPositionX(), object->GetPositionY(), object->GetPositionZ());
|
||||
object->RelocateStationaryPosition(object->GetPositionX(), object->GetPositionY(), object->GetPositionZ(), object->GetOrientation());
|
||||
object->SetWorldRotationAngles(oz, oy, ox);
|
||||
object->DestroyForNearbyPlayers();
|
||||
object->UpdateObjectVisibility();
|
||||
Map* map = object->GetMap();
|
||||
|
||||
object->Relocate(object->GetPositionX(), object->GetPositionY(), object->GetPositionZ(), oz);
|
||||
object->SetWorldRotationAngles(oz, oy, ox);
|
||||
object->SaveToDB();
|
||||
|
||||
handler->PSendSysMessage(LANG_COMMAND_TURNOBJMESSAGE, std::to_string(object->GetSpawnId()).c_str(), object->GetGOInfo()->name.c_str(), object->GetGUID().ToString().c_str(), object->GetOrientation());
|
||||
// Generate a completely new spawn with new guid
|
||||
// 3.3.5a client caches recently deleted objects and brings them back to life
|
||||
// when CreateObject block for this guid is received again
|
||||
// however it entirely skips parsing that block and only uses already known location
|
||||
object->Delete();
|
||||
|
||||
object = GameObject::CreateGameObjectFromDB(guidLow, map);
|
||||
if (!object)
|
||||
return false;
|
||||
|
||||
handler->PSendSysMessage(LANG_COMMAND_TURNOBJMESSAGE, std::to_string(object->GetSpawnId()).c_str(), object->GetGOInfo()->name.c_str(), object->GetGUID().ToString().c_str(), object->GetOrientation());
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -471,14 +478,22 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
object->DestroyForNearbyPlayers();
|
||||
object->RelocateStationaryPosition(x, y, z, object->GetOrientation());
|
||||
object->GetMap()->GameObjectRelocation(object, x, y, z, object->GetOrientation());
|
||||
Map* map = object->GetMap();
|
||||
|
||||
object->Relocate(x, y, z, object->GetOrientation());
|
||||
object->SaveToDB();
|
||||
|
||||
handler->PSendSysMessage(LANG_COMMAND_MOVEOBJMESSAGE, std::to_string(object->GetSpawnId()).c_str(), object->GetGOInfo()->name.c_str(), object->GetGUID().ToString().c_str());
|
||||
// Generate a completely new spawn with new guid
|
||||
// 3.3.5a client caches recently deleted objects and brings them back to life
|
||||
// when CreateObject block for this guid is received again
|
||||
// however it entirely skips parsing that block and only uses already known location
|
||||
object->Delete();
|
||||
|
||||
object = GameObject::CreateGameObjectFromDB(guidLow, map);
|
||||
if (!object)
|
||||
return false;
|
||||
|
||||
handler->PSendSysMessage(LANG_COMMAND_MOVEOBJMESSAGE, std::to_string(object->GetSpawnId()).c_str(), object->GetGOInfo()->name.c_str(), object->GetGUID().ToString().c_str());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user