diff --git a/Source/Framework/Logging/Log.cs b/Source/Framework/Logging/Log.cs index 613a756c9..d6e0a49b4 100644 --- a/Source/Framework/Logging/Log.cs +++ b/Source/Framework/Logging/Log.cs @@ -310,12 +310,13 @@ public class Log return GetLoggerByType(parentLogger); } - public static bool SetLogLevel(string name, string newLevelc, bool isLogger = true) + public static bool SetLogLevel(string name, int newLeveli, bool isLogger = true) { - LogLevel newLevel = (LogLevel)uint.Parse(newLevelc); - if (newLevel < 0) + if (newLeveli < 0) return false; + LogLevel newLevel = (LogLevel)newLeveli; + if (isLogger) { foreach (var logger in loggers.Values) diff --git a/Source/Game/Chat/Commands/ServerCommands.cs b/Source/Game/Chat/Commands/ServerCommands.cs index 9b64df59f..4d5eb3245 100644 --- a/Source/Game/Chat/Commands/ServerCommands.cs +++ b/Source/Game/Chat/Commands/ServerCommands.cs @@ -344,19 +344,12 @@ namespace Game.Chat } [Command("loglevel", RBACPermissions.CommandServerSetLoglevel, true)] - static bool HandleServerSetLogLevelCommand(CommandHandler handler, StringArguments args) + static bool HandleServerSetLogLevelCommand(CommandHandler handler, string type, string name, int level) { - if (args.Empty()) + if (name.IsEmpty() || level < 0 || (type != "a" && type != "l")) return false; - string type = args.NextString(); - string name = args.NextString(); - string level = args.NextString(); - - if (type.IsEmpty() || name.IsEmpty() || level.IsEmpty() || (type[0] != 'a' && type[0] != 'l')) - return false; - - return Log.SetLogLevel(name, level, type[0] == 'l'); + return Log.SetLogLevel(name, level, type == "l"); } [Command("motd", RBACPermissions.CommandServerSetMotd, true)] diff --git a/Source/Game/Maps/Instances/InstanceScript.cs b/Source/Game/Maps/Instances/InstanceScript.cs index 393bff3ba..ce296600f 100644 --- a/Source/Game/Maps/Instances/InstanceScript.cs +++ b/Source/Game/Maps/Instances/InstanceScript.cs @@ -911,8 +911,6 @@ namespace Game.Maps return false; } - public virtual void Initialize() { } - public virtual void Update(uint diff) { } // Called when a player successfully enters the instance. diff --git a/Source/Game/Movement/Generators/FlightPathMovementGenerator.cs b/Source/Game/Movement/Generators/FlightPathMovementGenerator.cs index 151084e63..8906e5718 100644 --- a/Source/Game/Movement/Generators/FlightPathMovementGenerator.cs +++ b/Source/Game/Movement/Generators/FlightPathMovementGenerator.cs @@ -191,7 +191,7 @@ namespace Game.Movement { uint path, cost; Global.ObjectMgr.GetTaxiPath(taxi[src], taxi[dst], out path, out cost); - if (path > CliDB.TaxiPathNodesByPath.Keys.Max()) + if (path >= CliDB.TaxiPathNodesByPath.Keys.Max()) return; var nodes = CliDB.TaxiPathNodesByPath[path]; diff --git a/Source/Game/Spells/SpellManager.cs b/Source/Game/Spells/SpellManager.cs index 898a378f0..84953fc2d 100644 --- a/Source/Game/Spells/SpellManager.cs +++ b/Source/Game/Spells/SpellManager.cs @@ -3247,6 +3247,7 @@ namespace Game.Entities 58552, // Return to Orgrimmar 58533, // Return to Stormwind 21855, // Challenge Flag + 38762, // Force of Neltharaku 51122, // Fierce Lightning Stike 71848 // Toxic Wasteling Find Target }, spellInfo => diff --git a/Source/Game/Warden/WardenCheckManager.cs b/Source/Game/Warden/WardenCheckManager.cs index 859f117aa..9eea3cc21 100644 --- a/Source/Game/Warden/WardenCheckManager.cs +++ b/Source/Game/Warden/WardenCheckManager.cs @@ -132,7 +132,7 @@ namespace Game if (action > WardenActions.Ban) Log.outError(LogFilter.Warden, "Warden check override action out of range (ID: {0}, action: {1})", checkId, action); // Check if check actually exists before accessing the CheckStore vector - else if (checkId > CheckStore.Count) + else if (checkId >= CheckStore.Count) Log.outError(LogFilter.Warden, "Warden check action override for non-existing check (ID: {0}, action: {1}), skipped", checkId, action); else { diff --git a/Source/Scripts/World/NpcSpecial.cs b/Source/Scripts/World/NpcSpecial.cs index 739b72efb..9d36bfdc5 100644 --- a/Source/Scripts/World/NpcSpecial.cs +++ b/Source/Scripts/World/NpcSpecial.cs @@ -1115,6 +1115,14 @@ namespace Scripts.World.NpcSpecial [Script] class npc_garments_of_quests : EscortAI { + ObjectGuid CasterGUID; + + bool IsHealed; + bool CanRun; + + uint RunAwayTimer; + uint quest; + public npc_garments_of_quests(Creature creature) : base(creature) { switch (me.GetEntry()) @@ -1139,25 +1147,22 @@ namespace Scripts.World.NpcSpecial break; } - Reset(); + Initialize(); } - ObjectGuid CasterGUID; + void Initialize() + { + IsHealed = false; + CanRun = false; - bool IsHealed; - bool CanRun; - - uint RunAwayTimer; - uint quest; + RunAwayTimer = 5000; + } public override void Reset() { CasterGUID.Clear(); - IsHealed = false; - CanRun = false; - - RunAwayTimer = 5000; + Initialize(); me.SetStandState(UnitStandStateType.Kneel); // expect database to have RegenHealth=0