Core/WorldStates: Allow setting "hidden" field of SMSG_UPDATE_WORLD_STATE

Port From (https://github.com/TrinityCore/TrinityCore/commit/de26cafbbe1b355b69ec871f4fee0704a3ef29a5)
This commit is contained in:
hondacrx
2022-07-09 12:37:04 -04:00
parent 5404654d65
commit c6ecb00c0a
5 changed files with 40 additions and 38 deletions
+2 -1
View File
@@ -584,7 +584,7 @@ namespace Game.Maps
public Dictionary<int, int> GetWorldStateValues() { return _worldStateValues; }
public void SetWorldStateValue(int worldStateId, int value)
public void SetWorldStateValue(int worldStateId, int value, bool hidden)
{
int oldValue = _worldStateValues.LookupByKey(worldStateId);
_worldStateValues[worldStateId] = value;
@@ -597,6 +597,7 @@ namespace Game.Maps
UpdateWorldState updateWorldState = new();
updateWorldState.VariableID = (uint)worldStateId;
updateWorldState.Value = value;
updateWorldState.Hidden = hidden;
updateWorldState.Write();
foreach (var player in GetPlayers())