mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-13 17:19:07 +00:00
fix(Core/GameObjects): Gameobject rotation and moving actions not updating to client (#5223)
This commit is contained in:
@@ -845,7 +845,7 @@ void GameObject::getFishLootJunk(Loot* fishloot, Player* loot_owner)
|
||||
}
|
||||
}
|
||||
|
||||
void GameObject::SaveToDB()
|
||||
void GameObject::SaveToDB(bool saveAddon /*= false*/)
|
||||
{
|
||||
// this should only be used when the gameobject has already been loaded
|
||||
// preferably after adding to map, because mapid may not be valid otherwise
|
||||
@@ -856,10 +856,10 @@ void GameObject::SaveToDB()
|
||||
return;
|
||||
}
|
||||
|
||||
SaveToDB(GetMapId(), data->spawnMask, data->phaseMask);
|
||||
SaveToDB(GetMapId(), data->spawnMask, data->phaseMask, saveAddon);
|
||||
}
|
||||
|
||||
void GameObject::SaveToDB(uint32 mapid, uint8 spawnMask, uint32 phaseMask)
|
||||
void GameObject::SaveToDB(uint32 mapid, uint8 spawnMask, uint32 phaseMask, bool saveAddon /*= false*/)
|
||||
{
|
||||
const GameObjectTemplate* goI = GetGOInfo();
|
||||
|
||||
@@ -914,6 +914,14 @@ void GameObject::SaveToDB(uint32 mapid, uint8 spawnMask, uint32 phaseMask)
|
||||
stmt->setUInt8(index++, uint8(GetGoState()));
|
||||
trans->Append(stmt);
|
||||
|
||||
if (saveAddon && !sObjectMgr->GetGameObjectAddon(m_spawnId))
|
||||
{
|
||||
index = 0;
|
||||
stmt = WorldDatabase.GetPreparedStatement(WORLD_INS_GAMEOBJECT_ADDON);
|
||||
stmt->setUInt32(index++, m_spawnId);
|
||||
trans->Append(stmt);
|
||||
}
|
||||
|
||||
WorldDatabase.CommitTransaction(trans);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user