Core/Entities: debloat SummonGameObject parameter list using proper wrappers and enable GO rotation in scripts

- There's still an overload allowing for x, y, z, o to be passed directly
- Fixed default animstate for GameObject creation in many places, it should be 255, not 100 (checked in sniffs)

(cherry picked from commit 62bfee37cb21584cef631dda428feaf5eb829cda)

Conflicts:
	src/server/game/Entities/GameObject/GameObject.cpp
	src/server/game/Entities/Object/Object.cpp
	src/server/game/Spells/SpellEffects.cpp
	src/server/scripts/Commands/cs_gobject.cpp
	src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp
	src/server/scripts/Kalimdor/zone_feralas.cpp
This commit is contained in:
ariel- committed 2016-08-01 01:23:47 -03:00
1 parent 8ff67eb6ac
commit 30d4f70533
37 files changed
+117 -135

No files matched your search

+4 -15
View File
@@ -139,16 +139,12 @@ public:
}
Player* player = handler->GetSession()->GetPlayer();
float x = float(player->GetPositionX());
float y = float(player->GetPositionY());
float z = float(player->GetPositionZ());
float o = float(player->GetOrientation());
Map* map = player->GetMap();
GameObject* object = new GameObject;
ObjectGuid::LowType guidLow = map->GenerateLowGuid<HighGuid::GameObject>();
if (!object->Create(guidLow, objectInfo->entry, map, 0, x, y, z, o, G3D::Quat(), 0, GO_STATE_READY))
if (!object->Create(guidLow, objectInfo->entry, map, 0, *player, G3D::Quat(), 255, GO_STATE_READY))
{
delete object;
return false;
@@ -181,7 +177,7 @@ public:
/// @todo is it really necessary to add both the real and DB table guid here ?
sObjectMgr->AddGameobjectToGrid(guidLow, sObjectMgr->GetGOData(guidLow));
handler->PSendSysMessage(LANG_GAMEOBJECT_ADD, objectId, objectInfo->name.c_str(), guidLow, x, y, z);
handler->PSendSysMessage(LANG_GAMEOBJECT_ADD, objectId, objectInfo->name.c_str(), guidLow, player->GetPositionX(), player->GetPositionY(), player->GetPositionZ());
return true;
}
@@ -203,14 +199,7 @@ public:
if (spawntime)
spawntm = atoi((char*)spawntime);
float x = player->GetPositionX();
float y = player->GetPositionY();
float z = player->GetPositionZ();
float ang = player->GetOrientation();
float rot2 = std::sin(ang/2);
float rot3 = std::cos(ang/2);
G3D::Quat rotation = G3D::Matrix3::fromEulerAnglesZYX(player->GetOrientation(), 0.f, 0.f);
uint32 objectId = atoi(id);
if (!sObjectMgr->GetGameObjectTemplate(objectId))
@@ -220,7 +209,7 @@ public:
return false;
}
player->SummonGameObject(objectId, x, y, z, ang, 0, 0, rot2, rot3, spawntm);
player->SummonGameObject(objectId, *player, rotation, spawntm);
return true;
}