mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-02-28 14:35:57 +00:00
fix(Core/GameObject): Use quaternion rotation directly instead of orientation hackfix (#24602)
Co-authored-by: blinkysc <blinkysc@users.noreply.github.com> Co-authored-by: zergtmn <zerg@myisp.com>
This commit is contained in:
@@ -1355,8 +1355,8 @@ void ObjectMgr::LoadGameObjectAddons()
|
||||
{
|
||||
uint32 oldMSTime = getMSTime();
|
||||
|
||||
// 0 1 2
|
||||
QueryResult result = WorldDatabase.Query("SELECT guid, invisibilityType, invisibilityValue FROM gameobject_addon");
|
||||
// 0 1 2 3 4 5 6
|
||||
QueryResult result = WorldDatabase.Query("SELECT guid, parent_rotation0, parent_rotation1, parent_rotation2, parent_rotation3, invisibilityType, invisibilityValue FROM gameobject_addon");
|
||||
|
||||
if (!result)
|
||||
{
|
||||
@@ -1380,8 +1380,9 @@ void ObjectMgr::LoadGameObjectAddons()
|
||||
}
|
||||
|
||||
GameObjectAddon& gameObjectAddon = _gameObjectAddonStore[guid];
|
||||
gameObjectAddon.invisibilityType = InvisibilityType(fields[1].Get<uint8>());
|
||||
gameObjectAddon.InvisibilityValue = fields[2].Get<uint32>();
|
||||
gameObjectAddon.ParentRotation = QuaternionData(fields[1].Get<float>(), fields[2].Get<float>(), fields[3].Get<float>(), fields[4].Get<float>());
|
||||
gameObjectAddon.invisibilityType = InvisibilityType(fields[5].Get<uint8>());
|
||||
gameObjectAddon.InvisibilityValue = fields[6].Get<uint32>();
|
||||
|
||||
if (gameObjectAddon.invisibilityType >= TOTAL_INVISIBILITY_TYPES)
|
||||
{
|
||||
@@ -1396,6 +1397,12 @@ void ObjectMgr::LoadGameObjectAddons()
|
||||
gameObjectAddon.InvisibilityValue = 1;
|
||||
}
|
||||
|
||||
if (!gameObjectAddon.ParentRotation.IsUnit())
|
||||
{
|
||||
LOG_ERROR("sql.sql", "GameObject (GUID: {}) has invalid parent rotation in `gameobject_addon`, set to default", guid);
|
||||
gameObjectAddon.ParentRotation = QuaternionData();
|
||||
}
|
||||
|
||||
++count;
|
||||
} while (result->NextRow());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user