Core/WorldStates: Skip sending SMSG_UPDATE_WORLD_STATE when value does not change
This commit is contained in:
1 parent
0a5de93e82
commit
030fe869df
2 files changed
+8
-2
No files matched your search
@@ -3534,8 +3534,11 @@ int32 Map::GetWorldStateValue(int32 worldStateId) const
|
||||
|
||||
void Map::SetWorldStateValue(int32 worldStateId, int32 value, bool hidden)
|
||||
{
|
||||
auto itr = _worldStateValues.try_emplace(worldStateId, 0).first;
|
||||
auto [itr, inserted] = _worldStateValues.try_emplace(worldStateId, 0);
|
||||
int32 oldValue = itr->second;
|
||||
if (oldValue == value && !inserted)
|
||||
return;
|
||||
|
||||
itr->second = value;
|
||||
|
||||
WorldStateTemplate const* worldStateTemplate = sWorldStateMgr->GetWorldStateTemplate(worldStateId);
|
||||
|
||||
Reference in new issue
Block a user