Core/Misc: Misc fixes

This commit is contained in:
hondacrx
2018-05-08 15:36:57 -04:00
parent f26f7a4348
commit 6224c4f6be
4 changed files with 6 additions and 8 deletions
+3 -3
View File
@@ -2370,12 +2370,12 @@ namespace Game.Entities
// between UNIT_FIELD_SCALING_LEVEL_MIN and UNIT_FIELD_SCALING_LEVEL_MAX // between UNIT_FIELD_SCALING_LEVEL_MIN and UNIT_FIELD_SCALING_LEVEL_MAX
if (HasScalableLevels()) if (HasScalableLevels())
{ {
uint targetLevelWithDelta = (uint)(unitTarget.getLevel() + GetInt32Value(UnitFields.ScalingLevelDelta)); int targetLevelWithDelta = ((int)unitTarget.getLevel() + GetInt32Value(UnitFields.ScalingLevelDelta));
if (target.IsPlayer()) 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));
} }
} }
+1 -1
View File
@@ -248,7 +248,7 @@ namespace Game.Maps
bool relocated_for_ai = (i_player == i_player.seerView); 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()); vis_guids.Remove(creature.GetGUID());
+1 -1
View File
@@ -79,7 +79,7 @@ namespace Game.Maps
private Queue<MapUpdateRequest> _queue; private Queue<MapUpdateRequest> _queue;
private object _syncLock = new object(); private object _syncLock = new object();
private AutoResetEvent[] autoResetEvent; private WaitHandle[] autoResetEvent;
} }
public class MapUpdateRequest public class MapUpdateRequest
+1 -3
View File
@@ -266,9 +266,7 @@ namespace Game
public bool ModifyReputation(FactionRecord factionEntry, int standing, bool noSpillover = false) { return SetReputation(factionEntry, standing, true, noSpillover); } 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 = false, bool noSpillover = false)
public bool SetReputation(FactionRecord factionEntry, int standing, bool incremental = true, bool noSpillover = false)
{ {
Global.ScriptMgr.OnPlayerReputationChange(_player, factionEntry.Id, standing, incremental); Global.ScriptMgr.OnPlayerReputationChange(_player, factionEntry.Id, standing, incremental);
bool res = false; bool res = false;