Skip to content

Commit

Permalink
Core/Datastores: hardcode the return value of DB2Manager::GetEmptyAni…
Browse files Browse the repository at this point in the history
…mStateID() to match the expected client value

This is a necessary change for classic clients as the AnimationdData storage does not have the retail data needed to match that expected size
  • Loading branch information
Ovahlord committed Jan 28, 2024
1 parent e07e3ba commit 0785ac6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
3 changes: 2 additions & 1 deletion src/server/game/DataStores/DB2Stores.cpp
Expand Up @@ -1760,7 +1760,8 @@ std::vector<DB2Manager::HotfixOptionalData> const* DB2Manager::GetHotfixOptional

uint32 DB2Manager::GetEmptyAnimStateID() const
{
return sAnimationDataStore.GetNumRows();
//return sAnimationDataStore.GetNumRows();
return 1772; // the Classic client expects the retail storage size so we have to hardcode the value
}

void DB2Manager::InsertNewHotfix(uint32 tableHash, uint32 recordId)
Expand Down
4 changes: 1 addition & 3 deletions src/server/game/Entities/Creature/Creature.cpp
Expand Up @@ -609,9 +609,7 @@ bool Creature::UpdateEntry(uint32 entry, CreatureData const* data /*= nullptr*/,

ReplaceAllDynamicFlags(UNIT_DYNFLAG_NONE);

//SetUpdateFieldValue(m_values.ModifyValue(&Unit::m_unitData).ModifyValue(&UF::UnitData::StateAnimID), sDB2Manager.GetEmptyAnimStateID());
constexpr uint32 stateAnimId = 1772; // the WotLK classic client expects the retail AnimationEntry db2 storage size so we have to hardcode it for the time being
SetUpdateFieldValue(m_values.ModifyValue(&Unit::m_unitData).ModifyValue(&UF::UnitData::StateAnimID), stateAnimId);
SetUpdateFieldValue(m_values.ModifyValue(&Unit::m_unitData).ModifyValue(&UF::UnitData::StateAnimID), sDB2Manager.GetEmptyAnimStateID());

SetCanDualWield(cInfo->flags_extra & CREATURE_FLAG_EXTRA_USE_OFFHAND_ATTACK);

Expand Down
4 changes: 1 addition & 3 deletions src/server/game/Entities/GameObject/GameObject.cpp
Expand Up @@ -1052,9 +1052,7 @@ bool GameObject::Create(uint32 entry, Map* map, Position const& pos, QuaternionD
SetGoState(goState);
SetGoArtKit(artKit);

//SetUpdateFieldValue(m_values.ModifyValue(&GameObject::m_gameObjectData).ModifyValue(&UF::GameObjectData::SpawnTrackingStateAnimID), sDB2Manager.GetEmptyAnimStateID());
constexpr uint32 spawnTrackingAnimId = 1772; // the WotLK classic client expects the retail AnimationEntry db2 storage size so we have to hardcode it for the time being
SetUpdateFieldValue(m_values.ModifyValue(&GameObject::m_gameObjectData).ModifyValue(&UF::GameObjectData::SpawnTrackingStateAnimID), spawnTrackingAnimId);
SetUpdateFieldValue(m_values.ModifyValue(&GameObject::m_gameObjectData).ModifyValue(&UF::GameObjectData::SpawnTrackingStateAnimID), sDB2Manager.GetEmptyAnimStateID());

switch (goInfo->type)
{
Expand Down

0 comments on commit 0785ac6

Please sign in to comment.