Housing: Fix 0/0 decor budget display by sending CREATE for missing entities
Account and HousingPlayerHouseEntity get destroyed on the client during map transfers to the housing map. The edit mode handler always sent VALUES_UPDATE, which the client "rescued" (ignored) because the entities no longer existed in its object cache. Now check HaveAtClient() first — if the client doesn't have the entity, send a full CREATE_OBJECT and re-register the GUID in m_clientGUIDs. This ensures the client receives InteriorDecorPlacementBudget, storage entries, and DecorMaxOwnedCount needed for the decor count display.
This commit is contained in:
@@ -528,10 +528,25 @@ void WorldSession::HandleHousingDecorSetEditMode(WorldPackets::Housing::HousingD
|
||||
|
||||
// Player VALUES_UPDATE (EditorMode=1 + UNIT_FLAG_PACIFIED + UNIT_FLAG2_NO_ACTIONS)
|
||||
player->BuildValuesUpdateBlockForPlayer(&updateData, player);
|
||||
// Account VALUES_UPDATE (FHousingStorage_C)
|
||||
GetBattlenetAccount().BuildValuesUpdateBlockForPlayer(&updateData, player);
|
||||
// HousingPlayerHouseEntity VALUES_UPDATE (budgets, level, favor, etc.)
|
||||
GetHousingPlayerHouseEntity().BuildValuesUpdateBlockForPlayer(&updateData, player);
|
||||
|
||||
// Account + HousingPlayerHouseEntity: send CREATE if the client doesn't
|
||||
// have them (they get destroyed during map transfers to the housing map),
|
||||
// otherwise send VALUES_UPDATE.
|
||||
if (player->HaveAtClient(&GetBattlenetAccount()))
|
||||
GetBattlenetAccount().BuildValuesUpdateBlockForPlayer(&updateData, player);
|
||||
else
|
||||
{
|
||||
GetBattlenetAccount().BuildCreateUpdateBlockForPlayer(&updateData, player);
|
||||
player->m_clientGUIDs.insert(GetBattlenetAccount().GetGUID());
|
||||
}
|
||||
|
||||
if (player->HaveAtClient(&GetHousingPlayerHouseEntity()))
|
||||
GetHousingPlayerHouseEntity().BuildValuesUpdateBlockForPlayer(&updateData, player);
|
||||
else
|
||||
{
|
||||
GetHousingPlayerHouseEntity().BuildCreateUpdateBlockForPlayer(&updateData, player);
|
||||
player->m_clientGUIDs.insert(GetHousingPlayerHouseEntity().GetGUID());
|
||||
}
|
||||
|
||||
updateData.BuildPacket(&updatePacket);
|
||||
player->SendDirectMessage(&updatePacket);
|
||||
|
||||
@@ -1298,8 +1298,23 @@ void WorldSession::HandleNeighborhoodBuyHouse(WorldPackets::Neighborhood::Neighb
|
||||
|
||||
UpdateData updateData(player->GetMapId());
|
||||
WorldPacket updatePacket;
|
||||
GetBattlenetAccount().BuildValuesUpdateBlockForPlayer(&updateData, player);
|
||||
GetHousingPlayerHouseEntity().BuildValuesUpdateBlockForPlayer(&updateData, player);
|
||||
|
||||
if (player->HaveAtClient(&GetBattlenetAccount()))
|
||||
GetBattlenetAccount().BuildValuesUpdateBlockForPlayer(&updateData, player);
|
||||
else
|
||||
{
|
||||
GetBattlenetAccount().BuildCreateUpdateBlockForPlayer(&updateData, player);
|
||||
player->m_clientGUIDs.insert(GetBattlenetAccount().GetGUID());
|
||||
}
|
||||
|
||||
if (player->HaveAtClient(&GetHousingPlayerHouseEntity()))
|
||||
GetHousingPlayerHouseEntity().BuildValuesUpdateBlockForPlayer(&updateData, player);
|
||||
else
|
||||
{
|
||||
GetHousingPlayerHouseEntity().BuildCreateUpdateBlockForPlayer(&updateData, player);
|
||||
player->m_clientGUIDs.insert(GetHousingPlayerHouseEntity().GetGUID());
|
||||
}
|
||||
|
||||
updateData.BuildPacket(&updatePacket);
|
||||
player->SendDirectMessage(&updatePacket);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user