From 6224c4f6be7257f71f1807bc560cae7c2a01f08c Mon Sep 17 00:00:00 2001 From: hondacrx Date: Tue, 8 May 2018 15:36:57 -0400 Subject: [PATCH] Core/Misc: Misc fixes --- Source/Game/Entities/Creature/Creature.cs | 6 +++--- Source/Game/Maps/GridNotifiers.cs | 2 +- Source/Game/Maps/MapUpdater.cs | 2 +- Source/Game/Reputation/ReputationManager.cs | 4 +--- 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/Source/Game/Entities/Creature/Creature.cs b/Source/Game/Entities/Creature/Creature.cs index 6c4eccc09..aeda8985d 100644 --- a/Source/Game/Entities/Creature/Creature.cs +++ b/Source/Game/Entities/Creature/Creature.cs @@ -2370,12 +2370,12 @@ namespace Game.Entities // between UNIT_FIELD_SCALING_LEVEL_MIN and UNIT_FIELD_SCALING_LEVEL_MAX if (HasScalableLevels()) { - uint targetLevelWithDelta = (uint)(unitTarget.getLevel() + GetInt32Value(UnitFields.ScalingLevelDelta)); + int targetLevelWithDelta = ((int)unitTarget.getLevel() + GetInt32Value(UnitFields.ScalingLevelDelta)); if (target.IsPlayer()) - targetLevelWithDelta += target.GetUInt32Value(PlayerFields.ScalingLevelDelta); + targetLevelWithDelta += target.GetInt32Value(PlayerFields.ScalingLevelDelta); - return MathFunctions.RoundToInterval(ref targetLevelWithDelta, GetUInt32Value(UnitFields.ScalingLevelMin), GetUInt32Value(UnitFields.ScalingLevelMax)); + return (uint)MathFunctions.RoundToInterval(ref targetLevelWithDelta, GetInt32Value(UnitFields.ScalingLevelMin), GetInt32Value(UnitFields.ScalingLevelMax)); } } diff --git a/Source/Game/Maps/GridNotifiers.cs b/Source/Game/Maps/GridNotifiers.cs index ac7af9e8e..3971805f2 100644 --- a/Source/Game/Maps/GridNotifiers.cs +++ b/Source/Game/Maps/GridNotifiers.cs @@ -248,7 +248,7 @@ namespace Game.Maps bool relocated_for_ai = (i_player == i_player.seerView); - foreach (var creature in objs) + foreach (var creature in objs.ToList()) { vis_guids.Remove(creature.GetGUID()); diff --git a/Source/Game/Maps/MapUpdater.cs b/Source/Game/Maps/MapUpdater.cs index e655b1508..59ac9b021 100644 --- a/Source/Game/Maps/MapUpdater.cs +++ b/Source/Game/Maps/MapUpdater.cs @@ -79,7 +79,7 @@ namespace Game.Maps private Queue _queue; private object _syncLock = new object(); - private AutoResetEvent[] autoResetEvent; + private WaitHandle[] autoResetEvent; } public class MapUpdateRequest diff --git a/Source/Game/Reputation/ReputationManager.cs b/Source/Game/Reputation/ReputationManager.cs index 9bf7e8158..612b9e3e1 100644 --- a/Source/Game/Reputation/ReputationManager.cs +++ b/Source/Game/Reputation/ReputationManager.cs @@ -266,9 +266,7 @@ namespace Game public bool ModifyReputation(FactionRecord factionEntry, int standing, bool noSpillover = false) { return SetReputation(factionEntry, standing, true, noSpillover); } - bool SetReputation(FactionRecord factionEntry, int standing) { return SetReputation(factionEntry, standing, false, false); } - - public bool SetReputation(FactionRecord factionEntry, int standing, bool incremental = true, bool noSpillover = false) + public bool SetReputation(FactionRecord factionEntry, int standing, bool incremental = false, bool noSpillover = false) { Global.ScriptMgr.OnPlayerReputationChange(_player, factionEntry.Id, standing, incremental); bool res = false;