mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-21 01:37:37 +01:00
Core/Misc: calculate rotation fields from orientation in some places it's impossible to get:
- SmartScripts: SMART_ACTION_SUMMON_GO
- Spell Effects:
* SPELL_EFFECT_DUEL
* SPELL_EFFECT_SUMMON_OBJECT_WILD
* SPELL_EFFECT_SUMMON_OBJECT_SLOT1
* SPELL_EFFECT_SUMMON_OBJECT_SLOT2
* SPELL_EFFECT_SUMMON_OBJECT_SLOT3
* SPELL_EFFECT_SUMMON_OBJECT_SLOT4
- Command Scripts: .gobject add
Closes #17891
(cherry picked from commit 14445d2202)
This commit is contained in:
@@ -118,10 +118,9 @@ public:
|
||||
if (!objectId)
|
||||
return false;
|
||||
|
||||
char* spawntimeSecs = strtok(NULL, " ");
|
||||
|
||||
const GameObjectTemplate* objectInfo = sObjectMgr->GetGameObjectTemplate(objectId);
|
||||
char* spawntimeSecs = strtok(nullptr, " ");
|
||||
|
||||
GameObjectTemplate const* objectInfo = sObjectMgr->GetGameObjectTemplate(objectId);
|
||||
if (!objectInfo)
|
||||
{
|
||||
handler->PSendSysMessage(LANG_GAMEOBJECT_NOT_EXIST, objectId);
|
||||
@@ -141,8 +140,10 @@ public:
|
||||
Player* player = handler->GetSession()->GetPlayer();
|
||||
Map* map = player->GetMap();
|
||||
|
||||
GameObject* object = new GameObject;
|
||||
if (!object->Create(objectInfo->entry, map, 0, *player, G3D::Quat(), 255, GO_STATE_READY))
|
||||
GameObject* object = new GameObject();
|
||||
|
||||
G3D::Quat rot = G3D::Matrix3::fromEulerAnglesZYX(player->GetOrientation(), 0.f, 0.f);
|
||||
if (!object->Create(objectInfo->entry, map, 0, *player, rot, 255, GO_STATE_READY))
|
||||
{
|
||||
delete object;
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user