aboutsummaryrefslogtreecommitdiff
path: root/src/game/Level2.cpp
diff options
context:
space:
mode:
authormegamage <none@none>2009-03-18 20:46:21 -0600
committermegamage <none@none>2009-03-18 20:46:21 -0600
commit249d0d53c0ec073f3b1f3366940a57c8563c3455 (patch)
treeb818c01d87d418c13c49f88c346dd5cd0db838bb /src/game/Level2.cpp
parentef47783882e609406f879856d2d3ce5ee865ec80 (diff)
[7489] Update gameobject rotation fields if need. Author: VladimirMangos
* Fixed update absent in ".gobject turn" command * Propetly set rotation fields for summoned objects * Check rotation/coordinates fields values at server loading --HG-- branch : trunk
Diffstat (limited to 'src/game/Level2.cpp')
-rw-r--r--src/game/Level2.cpp13
1 files changed, 2 insertions, 11 deletions
diff --git a/src/game/Level2.cpp b/src/game/Level2.cpp
index eea2e237035..4c5a8f51ce0 100644
--- a/src/game/Level2.cpp
+++ b/src/game/Level2.cpp
@@ -1793,17 +1793,11 @@ bool ChatHandler::HandleTurnObjectCommand(const char* args)
o = chr->GetOrientation();
}
- float rot2 = sin(o/2);
- float rot3 = cos(o/2);
-
Map* map = obj->GetMap();
map->Remove(obj,false);
obj->Relocate(obj->GetPositionX(), obj->GetPositionY(), obj->GetPositionZ(), o);
-
- obj->SetFloatValue(GAMEOBJECT_FACING, o);
- obj->SetFloatValue(GAMEOBJECT_PARENTROTATION+2, rot2);
- obj->SetFloatValue(GAMEOBJECT_PARENTROTATION+3, rot3);
+ obj->UpdateRotationFields();
map->Add(obj);
@@ -3582,13 +3576,10 @@ bool ChatHandler::HandleGameObjectCommand(const char* args)
float o = float(chr->GetOrientation());
Map *map = chr->GetMap();
- float rot2 = sin(o/2);
- float rot3 = cos(o/2);
-
GameObject* pGameObj = new GameObject;
uint32 db_lowGUID = objmgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT);
- if(!pGameObj->Create(db_lowGUID, goI->id, map, chr->GetPhaseMaskForSpawn(), x, y, z, o, 0, 0, rot2, rot3, 0, 1))
+ if(!pGameObj->Create(db_lowGUID, goI->id, map, chr->GetPhaseMaskForSpawn(), x, y, z, o, 0.0f, 0.0f, 0.0f, 0.0f, 0, 1))
{
delete pGameObj;
return false;