aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts/Commands
diff options
context:
space:
mode:
authorariel- <ariel.silva305@gmail.com>2016-07-30 11:34:02 +0200
committerjoschiwald <joschiwald.trinity@gmail.com>2017-02-11 19:10:43 +0100
commit02cef6f034804eb7291f7539936226c0552cad7f (patch)
tree6fb33c17902d8fd6e7435a6199c21eefc989fd82 /src/server/scripts/Commands
parent07f2f37329dc62944a9c22df7c76f5e0e85e7886 (diff)
Core/GameObjects: Gameobject rotation (from cmangos/mangos-wotlk@2bcbc0f) (#14146)
cmangos/mangos-wotlk@0fe88f35dfb: [11531] Normalize gameobject's quaternion, thanks to zergtmn for pointing cmangos/mangos-wotlk@060dfb791b: [11667] Implement transport path rotation cmangos/mangos-wotlk@565f52c6c1: [11806] A bit gameobject code refactoring cmangos/mangos-wotlk@6874951: [11807] Add gameobject_addon table Closes #14146 (cherry picked from commit 2967bf59b4a47837b85c995b732a6761c9c35f7e) # Conflicts: # src/server/game/Battlefield/Battlefield.cpp # src/server/game/Battlegrounds/Battleground.cpp # src/server/game/Entities/GameObject/GameObject.cpp # src/server/game/Entities/GameObject/GameObject.h # src/server/game/Entities/Object/Object.cpp # src/server/game/Globals/ObjectMgr.cpp # src/server/game/Spells/SpellEffects.cpp # src/server/scripts/Commands/cs_gobject.cpp # src/server/scripts/Northrend/Nexus/EyeOfEternity/instance_eye_of_eternity.cpp # src/server/scripts/OutdoorPvP/OutdoorPvPSI.cpp
Diffstat (limited to 'src/server/scripts/Commands')
-rw-r--r--src/server/scripts/Commands/cs_gobject.cpp27
1 files changed, 19 insertions, 8 deletions
diff --git a/src/server/scripts/Commands/cs_gobject.cpp b/src/server/scripts/Commands/cs_gobject.cpp
index 6de2b61b8be..493ae48148b 100644
--- a/src/server/scripts/Commands/cs_gobject.cpp
+++ b/src/server/scripts/Commands/cs_gobject.cpp
@@ -146,7 +146,7 @@ public:
Map* map = player->GetMap();
GameObject* object = new GameObject;
- if (!object->Create(objectInfo->entry, map, 0, x, y, z, o, 0.0f, 0.0f, 0.0f, 0.0f, 0, GO_STATE_READY))
+ if (!object->Create(objectInfo->entry, map, 0, x, y, z, o, G3D::Quat(), 0, GO_STATE_READY))
{
delete object;
return false;
@@ -416,25 +416,36 @@ public:
}
char* orientation = strtok(NULL, " ");
- float o;
+ float oz = 0.f, oy = 0.f, ox = 0.f;
if (orientation)
- o = (float)atof(orientation);
+ {
+ oz = float(atof(orientation));
+
+ orientation = strtok(NULL, " ");
+ if (orientation)
+ {
+ oy = float(atof(orientation));
+ orientation = strtok(NULL, " ");
+ if (orientation)
+ ox = float(atof(orientation));
+ }
+ }
else
{
Player* player = handler->GetSession()->GetPlayer();
- o = player->GetOrientation();
+ oz = player->GetOrientation();
}
- object->Relocate(object->GetPositionX(), object->GetPositionY(), object->GetPositionZ(), o);
- object->RelocateStationaryPosition(object->GetPositionX(), object->GetPositionY(), object->GetPositionZ(), o);
- object->UpdateRotationFields();
+ 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();
object->SaveToDB();
- handler->PSendSysMessage(LANG_COMMAND_TURNOBJMESSAGE, object->GetSpawnId(), 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(), object->GetOrientation());
return true;
}