From 5dacd669b54cc037730116652dade7bf17bdd099 Mon Sep 17 00:00:00 2001 From: hondacrx Date: Wed, 16 May 2018 19:57:48 -0400 Subject: [PATCH] Core/Refactor: Part 3 --- Source/Framework/Collections/BitSet.cs | 2 +- Source/Framework/Constants/MailConst.cs | 6 +- Source/Framework/Constants/PlayerConst.cs | 6 +- Source/Framework/Constants/UnitConst.cs | 6 + Source/Framework/Database/QueryCallback.cs | 3 +- Source/Framework/Dynamic/TaskScheduler.cs | 2 + Source/Framework/GameMath/Plane.cs | 2 +- Source/Framework/GameMath/Quaternion.cs | 10 +- Source/Framework/GameMath/Ray.cs | 1 - Source/Framework/GameMath/Vector2.cs | 11 +- Source/Framework/GameMath/Vector3.cs | 11 +- Source/Framework/GameMath/Vector4.cs | 11 +- .../RecastDetour/Detour/DetourCommon.cs | 58 ++--- .../RecastDetour/Detour/DetourNavMesh.cs | 104 ++++----- .../Detour/DetourNavMeshBuilder.cs | 128 +++++------ .../RecastDetour/Detour/DetourNavMeshQuery.cs | 208 +++++++++--------- Source/Framework/Serialization/Json.cs | 2 +- Source/Framework/Util/CollectionExtensions.cs | 19 +- Source/Framework/Util/Extensions.cs | 4 +- Source/Framework/Util/RandomHelper.cs | 4 +- Source/Game/AI/CoreAI/CombatAI.cs | 2 +- Source/Game/AI/CoreAI/PetAI.cs | 2 +- Source/Game/AI/CoreAI/TotemAI.cs | 1 - Source/Game/AI/ScriptedAI/ScriptedAI.cs | 4 +- .../Game/AI/ScriptedAI/ScriptedFollowerAI.cs | 2 +- Source/Game/AI/SmartScripts/SmartAIManager.cs | 2 +- Source/Game/AI/SmartScripts/SmartScript.cs | 2 +- .../Game/Achievements/AchievementManager.cs | 6 +- Source/Game/BattleFields/Zones/WinterGrasp.cs | 2 +- .../BattleFields/Zones/WinterGraspConst.cs | 28 +-- Source/Game/BattleGrounds/BattleGround.cs | 2 +- Source/Game/BattleGrounds/Zones/EyeofStorm.cs | 2 +- Source/Game/Chat/Channels/Channel.cs | 2 +- Source/Game/Chat/CommandHandler.cs | 4 +- Source/Game/Chat/Commands/AccountCommands.cs | 10 +- Source/Game/Chat/Commands/BanCommands.cs | 2 +- .../Game/Chat/Commands/CharacterCommands.cs | 4 +- Source/Game/Chat/Commands/DebugCommands.cs | 2 +- .../Game/Chat/Commands/GameObjectCommands.cs | 4 +- Source/Game/Chat/Commands/ListCommands.cs | 2 +- Source/Game/Chat/Commands/ReloadCommand.cs | 2 +- Source/Game/Chat/Commands/SendCommands.cs | 10 +- Source/Game/Collision/Models/WorldModel.cs | 2 +- Source/Game/Conditions/ConditionManager.cs | 2 +- Source/Game/DungeonFinding/LFGManager.cs | 2 +- Source/Game/DungeonFinding/LFGScripts.cs | 4 +- .../Game/Entities/AreaTrigger/AreaTrigger.cs | 2 +- .../AreaTrigger/AreaTriggerTemplate.cs | 52 +++-- Source/Game/Entities/Conversation.cs | 6 +- Source/Game/Entities/Creature/Creature.cs | 2 +- Source/Game/Entities/Creature/Gossip.cs | 8 +- Source/Game/Entities/GameObject/GameObject.cs | 8 +- Source/Game/Entities/Player/Player.Spells.cs | 4 +- Source/Game/Entities/Player/Player.cs | 18 +- Source/Game/Entities/TemporarySummon.cs | 2 +- Source/Game/Entities/Unit/Unit.Combat.cs | 2 +- Source/Game/Entities/Unit/Unit.Fields.cs | 6 +- Source/Game/Entities/Unit/Unit.Spells.cs | 11 +- Source/Game/Entities/Vehicle.cs | 4 +- Source/Game/Events/GameEventManager.cs | 6 +- Source/Game/Globals/ObjectManager.cs | 1 + Source/Game/Guilds/Guild.cs | 4 +- Source/Game/Handlers/AuctionHandler.cs | 2 +- Source/Game/Handlers/AuthenticationHandler.cs | 2 +- Source/Game/Handlers/BattleGroundHandler.cs | 4 +- Source/Game/Handlers/CalendarHandler.cs | 2 +- Source/Game/Handlers/CharacterHandler.cs | 34 +-- Source/Game/Handlers/ChatHandler.cs | 2 +- Source/Game/Handlers/InspectHandler.cs | 6 +- Source/Game/Handlers/ItemHandler.cs | 2 +- Source/Game/Handlers/LootHandler.cs | 2 +- Source/Game/Handlers/MovementHandler.cs | 2 +- Source/Game/Handlers/PetHandler.cs | 6 +- Source/Game/Handlers/QuestHandler.cs | 4 +- Source/Game/Handlers/SocialHandler.cs | 22 +- Source/Game/Handlers/SpellHandler.cs | 2 +- Source/Game/Handlers/TokenHandler.cs | 4 +- Source/Game/Loot/LootManager.cs | 4 +- Source/Game/Maps/Map.cs | 10 +- .../Game/Movement/Generators/PathGenerator.cs | 12 +- Source/Game/Movement/MoveSplineInitArgs.cs | 4 +- .../Network/Packets/AuthenticationPackets.cs | 4 +- .../Game/Network/Packets/CharacterPackets.cs | 4 +- Source/Game/Network/Packets/GuildPackets.cs | 4 +- Source/Game/Network/Packets/InspectPackets.cs | 6 +- Source/Game/Network/Packets/ItemPackets.cs | 4 +- .../Game/Network/Packets/ReputationPackets.cs | 2 +- Source/Game/Reputation/ReputationManager.cs | 2 +- Source/Game/Server/WorldManager.cs | 10 +- Source/Game/Server/WorldSession.cs | 4 +- Source/Game/Spells/Auras/Aura.cs | 14 +- Source/Game/Spells/Auras/AuraEffect.cs | 6 +- Source/Game/Spells/Spell.cs | 10 +- Source/Game/Spells/SpellHistory.cs | 7 - Source/Game/Spells/SpellManager.cs | 15 +- Source/Game/Warden/WardenWin.cs | 2 +- Source/Game/Weather/WeatherManager.cs | 4 +- .../Karazhan/InstanceKarazhan.cs | 2 +- Source/Scripts/Kalimdor/ZoneAshenvale.cs | 4 +- .../AzjolNerub/Ahnkahet/BossElderNadox.cs | 4 +- .../AzjolNerub/Ahnkahet/BossPrinceTaldaram.cs | 4 +- .../FrozenHalls/PitOfSaron/BossKrickAndIck.cs | 2 +- .../Nexus/EyeOfEternity/EyeOfEternity.cs | 2 +- .../Northrend/Nexus/Nexus/BossKeristrasza.cs | 2 +- .../Northrend/Ulduar/FlameLeviathan.cs | 6 +- Source/Scripts/Northrend/Ulduar/Mimiron.cs | 2 +- Source/Scripts/Outlands/HellfirePeninsula.cs | 2 +- Source/Scripts/Spells/Generic.cs | 6 +- Source/Scripts/Spells/Hunter.cs | 2 +- Source/Scripts/Spells/Priest.cs | 16 +- Source/Scripts/Spells/Warrior.cs | 2 +- Source/Scripts/World/GameObjects.cs | 4 +- 112 files changed, 564 insertions(+), 561 deletions(-) diff --git a/Source/Framework/Collections/BitSet.cs b/Source/Framework/Collections/BitSet.cs index eb25e4bf6..c3774b418 100644 --- a/Source/Framework/Collections/BitSet.cs +++ b/Source/Framework/Collections/BitSet.cs @@ -290,7 +290,7 @@ namespace System.Collections { Contract.Ensures(Contract.Result() >= 0); - return (int)_mLength; + return _mLength; } } diff --git a/Source/Framework/Constants/MailConst.cs b/Source/Framework/Constants/MailConst.cs index db9e712f4..54c1fb302 100644 --- a/Source/Framework/Constants/MailConst.cs +++ b/Source/Framework/Constants/MailConst.cs @@ -31,10 +31,10 @@ namespace Framework.Constants { None = 0x00, Read = 0x01, - Returned = 0x02, /// This Mail Was Returned. Do Not Allow Returning Mail Back Again. - Copied = 0x04, /// This Mail Was Copied. Do Not Allow Making A Copy Of Items In Mail. + Returned = 0x02, // This Mail Was Returned. Do Not Allow Returning Mail Back Again. + Copied = 0x04, // This Mail Was Copied. Do Not Allow Making A Copy Of Items In Mail. CodPayment = 0x08, - HasBody = 0x10 /// This Mail Has Body Text. + HasBody = 0x10 // This Mail Has Body Text. } public enum MailStationery diff --git a/Source/Framework/Constants/PlayerConst.cs b/Source/Framework/Constants/PlayerConst.cs index 050347d0f..face15717 100644 --- a/Source/Framework/Constants/PlayerConst.cs +++ b/Source/Framework/Constants/PlayerConst.cs @@ -323,9 +323,9 @@ namespace Framework.Constants SavePlayer = 0x01, ResurrectPlayer = 0x02, SpellCastDeserter = 0x04, - BGMountRestore = 0x08, ///< Flag to restore mount state after teleport from BG - BGTaxiRestore = 0x10, ///< Flag to restore taxi state after teleport from BG - BGGroupRestore = 0x20, ///< Flag to restore group state after teleport from BG + BGMountRestore = 0x08, // Flag to restore mount state after teleport from BG + BGTaxiRestore = 0x10, // Flag to restore taxi state after teleport from BG + BGGroupRestore = 0x20, // Flag to restore group state after teleport from BG End } diff --git a/Source/Framework/Constants/UnitConst.cs b/Source/Framework/Constants/UnitConst.cs index 81053459f..9579609a8 100644 --- a/Source/Framework/Constants/UnitConst.cs +++ b/Source/Framework/Constants/UnitConst.cs @@ -483,6 +483,12 @@ namespace Framework.Constants ChaseMove = 0x4000000, FollowMove = 0x8000000, IgnorePathfinding = 0x10000000, + AllStateSupported = Died | MeleeAttacking | Stunned | Roaming | Chase + | Fleeing | InFlight | Follow | Root | Confused + | Distracted | Isolated | AttackPlayer | Casting + | Possessed | Charging | Jumping | Move | Rotating + | Evade | RoamingMove | ConfusedMove | FleeingMove + | ChaseMove | FollowMove | IgnorePathfinding, Unattackable = InFlight, // For Real Move Using Movegen Check And Stop (Except Unstoppable Flight) Moving = RoamingMove | ConfusedMove | FleeingMove | ChaseMove | FollowMove, diff --git a/Source/Framework/Database/QueryCallback.cs b/Source/Framework/Database/QueryCallback.cs index e90bce63f..f6d0eca36 100644 --- a/Source/Framework/Database/QueryCallback.cs +++ b/Source/Framework/Database/QueryCallback.cs @@ -52,7 +52,7 @@ namespace Framework.Database public QueryCallbackStatus InvokeIfReady() { - QueryCallbackData callback = _callbacks.Dequeue(); + QueryCallbackData callback = _callbacks.Peek(); while (true) { @@ -64,6 +64,7 @@ namespace Framework.Database cb(this, f.Result); + _callbacks.Dequeue(); bool hasNext = _result != null; if (_callbacks.Count == 0) { diff --git a/Source/Framework/Dynamic/TaskScheduler.cs b/Source/Framework/Dynamic/TaskScheduler.cs index e3e0b9790..da616584e 100644 --- a/Source/Framework/Dynamic/TaskScheduler.cs +++ b/Source/Framework/Dynamic/TaskScheduler.cs @@ -78,6 +78,7 @@ namespace Framework.Dynamic /// Calls the optional callback on successfully finish. /// /// + /// /// public TaskScheduler Update(uint milliseconds, success_t callback = null) { @@ -89,6 +90,7 @@ namespace Framework.Dynamic /// Calls the optional callback on successfully finish. /// /// + /// /// TaskScheduler Update(TimeSpan difftime, success_t callback = null) { diff --git a/Source/Framework/GameMath/Plane.cs b/Source/Framework/GameMath/Plane.cs index ba66b4531..b29002746 100644 --- a/Source/Framework/GameMath/Plane.cs +++ b/Source/Framework/GameMath/Plane.cs @@ -236,7 +236,7 @@ namespace Framework.GameMath /// the specified object. /// /// An object to compare to this instance. - /// True if is a and has the same values as this instance; otherwise, False. + /// True if is a and has the same values as this instance; otherwise, False. public override bool Equals(object obj) { if (obj is Plane) diff --git a/Source/Framework/GameMath/Quaternion.cs b/Source/Framework/GameMath/Quaternion.cs index 8d1afa3b8..af61e56b9 100644 --- a/Source/Framework/GameMath/Quaternion.cs +++ b/Source/Framework/GameMath/Quaternion.cs @@ -258,7 +258,7 @@ namespace Framework.GameMath /// Converts the specified string to its equivalent. /// /// A string representation of a - /// A that represents the vector specified by the parameter. + /// A that represents the vector specified by the parameter. public static Quaternion Parse(string value) { Regex r = new Regex(@"\((?.*),(?.*),(?.*),(?.*)\)", RegexOptions.None); @@ -358,7 +358,7 @@ namespace Framework.GameMath } /// - /// Multiplies quaternion by quaternion . + /// Multiplies quaternion by quaternion . /// /// A instance. /// A instance. @@ -374,7 +374,7 @@ namespace Framework.GameMath return result; } /// - /// Multiplies quaternion by quaternion and put the result in a third quaternion. + /// Multiplies quaternion by quaternion and put the result in a third quaternion. /// /// A instance. /// A instance. @@ -617,7 +617,7 @@ namespace Framework.GameMath /// /// /// The quaternion values that are close to zero within the given tolerance are set to zero. - /// The tolerance value used is + /// The tolerance value used is /// public void ClampZero() { @@ -707,7 +707,7 @@ namespace Framework.GameMath return Quaternion.Subtract(left, right); } /// - /// Multiplies quaternion by quaternion . + /// Multiplies quaternion by quaternion . /// /// A instance. /// A instance. diff --git a/Source/Framework/GameMath/Ray.cs b/Source/Framework/GameMath/Ray.cs index 3fd1a0b1d..3b7c7f7ee 100644 --- a/Source/Framework/GameMath/Ray.cs +++ b/Source/Framework/GameMath/Ray.cs @@ -285,7 +285,6 @@ namespace Framework.GameMath /// The to use as the current culture. /// The to convert. /// An that represents the converted value. - /// Failed parsing from string. public override object ConvertFrom(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value) { if (value.GetType() == typeof(string)) diff --git a/Source/Framework/GameMath/Vector2.cs b/Source/Framework/GameMath/Vector2.cs index 3a7b9b5b1..ff0955605 100644 --- a/Source/Framework/GameMath/Vector2.cs +++ b/Source/Framework/GameMath/Vector2.cs @@ -530,7 +530,7 @@ namespace Framework.GameMath /// /// /// The vector values that are close to zero within the given tolerance are set to zero. - /// The tolerance value used is + /// The tolerance value used is /// public void ClampZero() { @@ -825,10 +825,10 @@ namespace Framework.GameMath return array; } /// - /// Converts the vector to a of single-precision floating point values. + /// Converts the vector to a of single-precision floating point values. /// /// A instance. - /// A of single-precision floating point values. + /// A of single-precision floating point values. public static explicit operator List(Vector2 vector) { List list = new List(); @@ -838,10 +838,10 @@ namespace Framework.GameMath return list; } /// - /// Converts the vector to a of single-precision floating point values. + /// Converts the vector to a of single-precision floating point values. /// /// A instance. - /// A of single-precision floating point values. + /// A of single-precision floating point values. public static explicit operator LinkedList(Vector2 vector) { LinkedList list = new LinkedList(); @@ -910,7 +910,6 @@ namespace Framework.GameMath /// The to use as the current culture. /// The to convert. /// An that represents the converted value. - /// Failed parsing from string. public override object ConvertFrom(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value) { if (value.GetType() == typeof(string)) diff --git a/Source/Framework/GameMath/Vector3.cs b/Source/Framework/GameMath/Vector3.cs index 7c2bb6474..8ed4c4a2d 100644 --- a/Source/Framework/GameMath/Vector3.cs +++ b/Source/Framework/GameMath/Vector3.cs @@ -554,7 +554,7 @@ namespace Framework.GameMath /// /// /// The vector values that are close to zero within the given tolerance are set to zero. - /// The tolerance value used is + /// The tolerance value used is /// public void ClampZero() { @@ -895,10 +895,10 @@ namespace Framework.GameMath return array; } /// - /// Converts the vector to a of single-precision floating point values. + /// Converts the vector to a of single-precision floating point values. /// /// A instance. - /// A of single-precision floating point values. + /// A of single-precision floating point values. public static explicit operator List(Vector3 vector) { List list = new List(3); @@ -909,10 +909,10 @@ namespace Framework.GameMath return list; } /// - /// Converts the vector to a of single-precision floating point values. + /// Converts the vector to a of single-precision floating point values. /// /// A instance. - /// A of single-precision floating point values. + /// A of single-precision floating point values. public static explicit operator LinkedList(Vector3 vector) { LinkedList list = new LinkedList(); @@ -1061,7 +1061,6 @@ namespace Framework.GameMath /// The to use as the current culture. /// The to convert. /// An that represents the converted value. - /// Failed parsing from string. public override object ConvertFrom(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value) { if (value.GetType() == typeof(string)) diff --git a/Source/Framework/GameMath/Vector4.cs b/Source/Framework/GameMath/Vector4.cs index 28d6ac167..08efb0722 100644 --- a/Source/Framework/GameMath/Vector4.cs +++ b/Source/Framework/GameMath/Vector4.cs @@ -576,7 +576,7 @@ namespace Framework.GameMath /// /// /// The vector values that are close to zero within the given tolerance are set to zero. - /// The tolerance value used is + /// The tolerance value used is /// public void ClampZero() { @@ -908,10 +908,10 @@ namespace Framework.GameMath return array; } /// - /// Converts the vector to a of single-precision floating point values. + /// Converts the vector to a of single-precision floating point values. /// /// A instance. - /// A of single-precision floating point values. + /// A of single-precision floating point values. public static explicit operator List(Vector4 vector) { List list = new List(4); @@ -923,10 +923,10 @@ namespace Framework.GameMath return list; } /// - /// Converts the vector to a of single-precision floating point values. + /// Converts the vector to a of single-precision floating point values. /// /// A instance. - /// A of single-precision floating point values. + /// A of single-precision floating point values. public static explicit operator LinkedList(Vector4 vector) { LinkedList list = new LinkedList(); @@ -997,7 +997,6 @@ namespace Framework.GameMath /// The to use as the current culture. /// The to convert. /// An that represents the converted value. - /// Failed parsing from string. public override object ConvertFrom(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value) { if (value.GetType() == typeof(string)) diff --git a/Source/Framework/RecastDetour/Detour/DetourCommon.cs b/Source/Framework/RecastDetour/Detour/DetourCommon.cs index adddad05d..35d94a3b7 100644 --- a/Source/Framework/RecastDetour/Detour/DetourCommon.cs +++ b/Source/Framework/RecastDetour/Detour/DetourCommon.cs @@ -247,8 +247,8 @@ public static partial class Detour /// @param[in] pt The point to check. [(x, y, z)] /// @param[in] verts The polygon vertices. [(x, y, z) * @p nverts] /// @param[in] nverts The number of vertices. [Limit: >= 3] - /// @return True if the point is inside the polygon. - /// @par + // @return True if the point is inside the polygon. + // @par /// /// All points are projected onto the xz-plane, so the y-values are ignored. public static bool dtPointInPolygon(float[] pt, float[] verts, int nverts) @@ -305,8 +305,8 @@ public static partial class Detour /// @param[in] npolya The number of vertices in polygon A. /// @param[in] polyb Polygon B vertices. [(x, y, z) * @p npolyb] /// @param[in] npolyb The number of vertices in polygon B. - /// @return True if the two polygons overlap. - /// @par + // @return True if the two polygons overlap. + // @par /// /// All vertices are projected onto the xz-plane, so the y-values are ignored. public static bool dtOverlapPolyPoly2D(float[] polya, int npolya, float[] polyb, int npolyb) @@ -478,9 +478,9 @@ public static partial class Detour return v < mn ? mn : (v > mx ? mx : v); } - /// @} - /// @name Vector helper functions. - /// @{ + // @} + // @name Vector helper functions. + // @{ /// Derives the cross product of two vectors. (@p v1 x @p v2) /// @param[out] dest The cross product. [(x, y, z)] @@ -495,7 +495,7 @@ public static partial class Detour /// Derives the dot product of two vectors. (@p v1 . @p v2) /// @param[in] v1 A Vector [(x, y, z)] /// @param[in] v2 A vector [(x, y, z)] - /// @return The dot product. + // @return The dot product. public static float dtVdot(float[] v1, float[] v2) { return v1[0] * v2[0] + v1[1] * v2[1] + v1[2] * v2[2]; @@ -521,7 +521,7 @@ public static partial class Detour /// @param[out] dest The result vector. [(x, y, x)] /// @param[in] v1 The starting vector. /// @param[in] v2 The destination vector. - /// @param[in] t The interpolation factor. [Limits: 0 <= value <= 1.0] + /// @param[in] t The interpolation factor. [Limits: 0 <= value <= 1.0] public static void dtVlerp(float[] dest, float[] v1, float[] v2, float t) { dest[0] = v1[0] + (v2[0] - v1[0]) * t; @@ -647,7 +647,7 @@ public static partial class Detour } /// Derives the scalar length of the vector. /// @param[in] v The vector. [(x, y, z)] - /// @return The scalar length of the vector. + // @return The scalar length of the vector. public static float dtVlen(float[] v) { return (float)Math.Sqrt(v[0] * v[0] + v[1] * v[1] + v[2] * v[2]); @@ -659,7 +659,7 @@ public static partial class Detour /// Derives the square of the scalar length of the vector. (len * len) /// @param[in] v The vector. [(x, y, z)] - /// @return The square of the scalar length of the vector. + // @return The square of the scalar length of the vector. public static float dtVlenSqr(float[] v) { return v[0] * v[0] + v[1] * v[1] + v[2] * v[2]; @@ -672,7 +672,7 @@ public static partial class Detour /// Returns the distance between two points. /// @param[in] v1 A point. [(x, y, z)] /// @param[in] v2 A point. [(x, y, z)] - /// @return The distance between the two points. + // @return The distance between the two points. public static float dtVdist(float[] v1, float[] v2) { float dx = v2[0] - v1[0]; @@ -691,7 +691,7 @@ public static partial class Detour /// Returns the square of the distance between two points. /// @param[in] v1 A point. [(x, y, z)] /// @param[in] v2 A point. [(x, y, z)] - /// @return The square of the distance between the two points. + // @return The square of the distance between the two points. public static float dtVdistSqr(float[] v1, float[] v2) { float dx = v2[0] - v1[0]; @@ -710,7 +710,7 @@ public static partial class Detour /// Derives the distance between the specified points on the xz-plane. /// @param[in] v1 A point. [(x, y, z)] /// @param[in] v2 A point. [(x, y, z)] - /// @return The distance between the point on the xz-plane. + // @return The distance between the point on the xz-plane. /// /// The vectors are projected onto the xz-plane, so the y-values are ignored. public static float dtVdist2D(float[] v1, float[] v2) @@ -728,7 +728,7 @@ public static partial class Detour /// Derives the square of the distance between the specified points on the xz-plane. /// @param[in] v1 A point. [(x, y, z)] /// @param[in] v2 A point. [(x, y, z)] - /// @return The square of the distance between the point on the xz-plane. + // @return The square of the distance between the point on the xz-plane. public static float dtVdist2DSqr(float[] v1, float[] v2) { float dx = v2[0] - v1[0]; @@ -761,7 +761,7 @@ public static partial class Detour /// Performs a 'sloppy' colocation check of the specified points. /// @param[in] p0 A point. [(x, y, z)] /// @param[in] p1 A point. [(x, y, z)] - /// @return True if the points are considered to be at the same location. + // @return True if the points are considered to be at the same location. /// /// Basically, this function will return true if the specified points are /// close enough to eachother to be considered colocated. @@ -782,7 +782,7 @@ public static partial class Detour /// Derives the dot product of two vectors on the xz-plane. (@p u . @p v) /// @param[in] u A vector [(x, y, z)] /// @param[in] v A vector [(x, y, z)] - /// @return The dot product on the xz-plane. + // @return The dot product on the xz-plane. /// /// The vectors are projected onto the xz-plane, so the y-values are ignored. public static float dtVdot2D(float[] u, float[] v) @@ -797,7 +797,7 @@ public static partial class Detour /// Derives the xz-plane 2D perp product of the two vectors. (uz*vx - ux*vz) /// @param[in] u The LHV vector [(x, y, z)] /// @param[in] v The RHV vector [(x, y, z)] - /// @return The dot product on the xz-plane. + // @return The dot product on the xz-plane. /// /// The vectors are projected onto the xz-plane, so the y-values are ignored. public static float dtVperp2D(float[] u, float[] v) @@ -808,9 +808,9 @@ public static partial class Detour { return u[uStart + 2] * v[vStart + 0] - u[uStart + 0] * v[vStart + 2]; } - /// @} - /// @name Computational geometry helper functions. - /// @{ + // @} + // @name Computational geometry helper functions. + // @{ /** @@ -856,7 +856,7 @@ public static partial class Detour /// @param[in] a Vertex A. [(x, y, z)] /// @param[in] b Vertex B. [(x, y, z)] /// @param[in] c Vertex C. [(x, y, z)] - /// @return The signed xz-plane area of the triangle. + // @return The signed xz-plane area of the triangle. public static float dtTriArea2D(float[] a, float[] b, float[] c) { float abx = b[0] - a[0]; @@ -878,8 +878,8 @@ public static partial class Detour /// @param[in] amax Maximum bounds of box A. [(x, y, z)] /// @param[in] bmin Minimum bounds of box B. [(x, y, z)] /// @param[in] bmax Maximum bounds of box B. [(x, y, z)] - /// @return True if the two AABB's overlap. - /// @see dtOverlapBounds + // @return True if the two AABB's overlap. + // @see dtOverlapBounds public static bool dtOverlapQuantBounds(ushort[] amin, ushort[] amax, ushort[] bmin, ushort[] bmax) { bool overlap = true; @@ -894,8 +894,8 @@ public static partial class Detour /// @param[in] amax Maximum bounds of box A. [(x, y, z)] /// @param[in] bmin Minimum bounds of box B. [(x, y, z)] /// @param[in] bmax Maximum bounds of box B. [(x, y, z)] - /// @return True if the two AABB's overlap. - /// @see dtOverlapQuantBounds + // @return True if the two AABB's overlap. + // @see dtOverlapQuantBounds public static bool dtOverlapBounds(float[] amin, float[] amax, float[] bmin, float[] bmax) { bool overlap = true; @@ -905,9 +905,9 @@ public static partial class Detour return overlap; } - /// @} - /// @name Miscellanious functions. - /// @{ + // @} + // @name Miscellanious functions. + // @{ public static uint dtNextPow2(uint v) { diff --git a/Source/Framework/RecastDetour/Detour/DetourNavMesh.cs b/Source/Framework/RecastDetour/Detour/DetourNavMesh.cs index 5efe2f026..c8c304858 100644 --- a/Source/Framework/RecastDetour/Detour/DetourNavMesh.cs +++ b/Source/Framework/RecastDetour/Detour/DetourNavMesh.cs @@ -164,7 +164,7 @@ public static partial class Detour return new(mem) dtNavMesh; } */ - /// @par + // @par /// /// This function will only free the memory for tiles with the #DT_TILE_FREE_DATA /// flag set. @@ -208,7 +208,7 @@ public static partial class Detour @see dtNavMeshQuery, dtCreateNavMeshData, dtNavMeshCreateParams, #dtAllocNavMesh, #dtFreeNavMesh */ /// A navigation mesh based on tiles of convex polygons. - /// @ingroup detour + // @ingroup detour public class dtNavMesh { private dtNavMeshParams m_params; //< Current initialization params. TODO: do not store this info twice. @@ -312,12 +312,12 @@ public static partial class Detour return (uint)(polyRef & polyMask); } - /// @{ - /// @name Initialization and Tile Management + // @{ + // @name Initialization and Tile Management /// Initializes the navigation mesh for tiled use. /// @param[in] params Initialization parameters. - /// @return The status flags for the operation. + // @return The status flags for the operation. public dtStatus init(dtNavMeshParams navMeshParams) { //memcpy(&m_params, params, sizeof(dtNavMeshParams)); @@ -363,7 +363,7 @@ public static partial class Detour /// @param[in] data Data of the new tile. (See: #dtCreateNavMeshData) /// @param[in] dataSize The data size of the new tile. /// @param[in] flags The tile flags. (See: #dtTileFlags) - /// @return The status flags for the operation. + // @return The status flags for the operation. /// @see dtCreateNavMeshData public dtStatus init(dtRawTileData rawTile, int flags) { @@ -394,9 +394,9 @@ public static partial class Detour } /// The navigation mesh initialization params. - /// @par + // @par /// - /// @note The parameters are created automatically when the single tile + // @note The parameters are created automatically when the single tile /// initialization is performed. public dtNavMeshParams getParams() { @@ -988,7 +988,7 @@ public static partial class Detour } } - /// @par + // @par /// /// The add operation will fail if the data is in the wrong format, the allocated tile /// space is full, or there is a tile already at the specified reference. @@ -998,14 +998,14 @@ public static partial class Detour /// tile will be restored to the same values they were before the tile was /// removed. /// - /// @see dtCreateNavMeshData, #removeTile + // @see dtCreateNavMeshData, #removeTile /// Adds a tile to the navigation mesh. /// @param[in] data Data for the new tile mesh. (See: #dtCreateNavMeshData) /// @param[in] dataSize Data size of the new tile mesh. /// @param[in] flags Tile flags. (See: #dtTileFlags) /// @param[in] lastRef The desired reference for the tile. (When reloading a tile.) [opt] [Default: 0] /// @param[out] result The tile reference. (If the tile was succesfully added.) [opt] - /// @return The status flags for the operation. + // @return The status flags for the operation. public dtStatus addTile(dtRawTileData rawTileData, int flags, dtTileRef lastRef, ref dtTileRef result) { //C#: Using an intermediate class dtRawTileData because Cpp uses a binary buffer. @@ -1153,7 +1153,7 @@ public static partial class Detour /// @param[in] x The tile's x-location. (x, y, layer) /// @param[in] y The tile's y-location. (x, y, layer) /// @param[in] layer The tile's layer. (x, y, layer) - /// @return The tile, or null if the tile does not exist. + // @return The tile, or null if the tile does not exist. public dtMeshTile getTileAt(int x, int y, int layer) { // Find tile based on hash. @@ -1192,7 +1192,7 @@ public static partial class Detour } - /// @par + // @par /// /// This function will not fail if the tiles array is too small to hold the /// entire result set. It will simply fill the array to capacity. @@ -1201,7 +1201,7 @@ public static partial class Detour /// @param[in] y The tile's y-location. (x, y) /// @param[out] tiles A pointer to an array of tiles that will hold the result. /// @param[in] maxTiles The maximum tiles the tiles parameter can hold. - /// @return The number of tiles returned in the tiles array. + // @return The number of tiles returned in the tiles array. public int getTilesAt(int x, int y, dtMeshTile[] tiles, int maxTiles) { int n = 0; @@ -1228,7 +1228,7 @@ public static partial class Detour /// @param[in] x The tile's x-location. (x, y, layer) /// @param[in] y The tile's y-location. (x, y, layer) /// @param[in] layer The tile's layer. (x, y, layer) - /// @return The tile reference of the tile, or 0 if there is none. + // @return The tile reference of the tile, or 0 if there is none. public dtTileRef getTileRefAt(int x, int y, int layer) { // Find tile based on hash. @@ -1249,7 +1249,7 @@ public static partial class Detour } /// Gets the tile for the specified tile reference. /// @param[in] ref The tile reference of the tile to retrieve. - /// @return The tile for the specified reference, or null if the + // @return The tile for the specified reference, or null if the /// reference is invalid. public dtMeshTile getTileByRef(dtTileRef tileRef) { @@ -1266,15 +1266,15 @@ public static partial class Detour } /// The maximum number of tiles supported by the navigation mesh. - /// @return The maximum number of tiles supported by the navigation mesh. + // @return The maximum number of tiles supported by the navigation mesh. public int getMaxTiles() { return m_maxTiles; } /// Gets the tile at the specified index. - /// @param[in] i The tile index. [Limit: 0 >= index < #getMaxTiles()] - /// @return The tile at the specified index. + /// @param[in] i The tile index. [Limit: 0 >= index < #getMaxTiles()] + // @return The tile at the specified index. public dtMeshTile getTile(int i) { return m_tiles[i]; @@ -1294,7 +1294,7 @@ public static partial class Detour /// @param[in] ref The reference for the a polygon. /// @param[out] tile The tile containing the polygon. /// @param[out] poly The polygon. - /// @return The status flags for the operation. + // @return The status flags for the operation. public dtStatus getTileAndPolyByRef(dtPolyRef polyRef, ref dtMeshTile tile, ref dtPoly poly) { if (polyRef == 0) @@ -1331,9 +1331,9 @@ public static partial class Detour return DT_SUCCESS; } - /// @par + // @par /// - /// @warning Only use this function if it is known that the provided polygon + // @warning Only use this function if it is known that the provided polygon /// reference is valid. This function is faster than #getTileAndPolyByRef, but /// it does not validate the reference. /// Returns the tile and polygon for the specified polygon reference. @@ -1358,7 +1358,7 @@ public static partial class Detour /// Checks the validity of a polygon reference. /// @param[in] ref The polygon reference to check. - /// @return True if polygon reference is valid for the navigation mesh. + // @return True if polygon reference is valid for the navigation mesh. public bool isValidPolyRef(dtPolyRef polyRef) { if (polyRef == 0) @@ -1374,17 +1374,17 @@ public static partial class Detour return true; } - /// @par + // @par /// /// This function returns the data for the tile so that, if desired, /// it can be added back to the navigation mesh at a later point. /// - /// @see #addTile + // @see #addTile /// Removes the specified tile from the navigation mesh. /// @param[in] ref The reference of the tile to remove. /// @param[out] data Data associated with deleted tile. /// @param[out] dataSize Size of the data associated with deleted tile. - /// @return The status flags for the operation. + // @return The status flags for the operation. public dtStatus removeTile(dtTileRef tileRef, out dtRawTileData rawTileData) { rawTileData = null; @@ -1488,7 +1488,7 @@ public static partial class Detour /// Gets the tile reference for the specified tile. /// @param[in] tile The tile. - /// @return The tile reference of the tile. + // @return The tile reference of the tile. public dtTileRef getTileRef(dtMeshTile tile) { if (tile == null) return 0; @@ -1496,23 +1496,23 @@ public static partial class Detour return encodePolyId(tile.salt, it, 0); } - /// @par + // @par /// /// Example use case: - /// @code + // @code /// /// const dtPolyRef base = navmesh.getPolyRefBase(tile); - /// for (int i = 0; i < tile.header.polyCount; ++i) + /// for (int i = 0; i < tile.header.polyCount; ++i) /// { - /// const dtPoly* p = &tile.polys[i]; + /// const dtPoly* p = tile.polys[i]; /// const dtPolyRef ref = base | (dtPolyRef)i; /// /// // Use the reference to access the polygon data. /// } - /// @endcode + // @endcode /// Gets the polygon reference for the tile's base polygon. /// @param[in] tile The tile. - /// @return The polygon reference for the base polygon in the specified tile. + // @return The polygon reference for the base polygon in the specified tile. public dtPolyRef getPolyRefBase(dtMeshTile tile) { if (tile == null) return 0; @@ -1525,7 +1525,7 @@ public static partial class Detour /// @see #storeTileState /// Gets the size of the buffer required by #storeTileState to store the specified tile's state. /// @param[in] tile The tile. - /// @return The size of the buffer required to store the state. + // @return The size of the buffer required to store the state. int getTileStateSize(dtMeshTile tile) { if (tile == null) return 0; @@ -1534,16 +1534,16 @@ public static partial class Detour return headerSize + polyStateSize; } - /// @par + // @par /// /// Tile state includes non-structural data such as polygon flags, area ids, etc. - /// @note The state data is only valid until the tile reference changes. - /// @see #getTileStateSize, #restoreTileState + // @note The state data is only valid until the tile reference changes. + // @see #getTileStateSize, #restoreTileState /// Stores the non-structural state of the tile in the specified buffer. (Flags, area ids, etc.) /// @param[in] tile The tile. /// @param[out] data The buffer to store the tile's state in. /// @param[in] maxDataSize The size of the data buffer. [Limit: >= #getTileStateSize] - /// @return The status flags for the operation. + // @return The status flags for the operation. dtStatus dtNavMesh::storeTileState(const dtMeshTile* tile, byte* data, const int maxDataSize) const { // Make sure there is enough space to store the state. @@ -1571,16 +1571,16 @@ public static partial class Detour return DT_SUCCESS; } - /// @par + // @par /// /// Tile state includes non-structural data such as polygon flags, area ids, etc. - /// @note This function does not impact the tile's #dtTileRef and #dtPolyRef's. - /// @see #storeTileState + // @note This function does not impact the tile's #dtTileRef and #dtPolyRef's. + // @see #storeTileState /// Restores the state of the tile. /// @param[in] tile The tile. /// @param[in] data The new state. (Obtained from #storeTileState.) /// @param[in] maxDataSize The size of the state within the data buffer. - /// @return The status flags for the operation. + // @return The status flags for the operation. dtStatus dtNavMesh::restoreTileState(dtMeshTile* tile, const byte* data, const int maxDataSize) { // Make sure there is enough space to store the state. @@ -1611,7 +1611,7 @@ public static partial class Detour return DT_SUCCESS; } */ - /// @par + // @par /// /// Off-mesh connections are stored in the navigation mesh as special 2-vertex /// polygons with a single edge. At least one of the vertices is expected to be @@ -1623,7 +1623,7 @@ public static partial class Detour /// @param[in] polyRef The reference of the off-mesh connection polygon. /// @param[out] startPos The start position of the off-mesh connection. [(x, y, z)] /// @param[out] endPos The end position of the off-mesh connection. [(x, y, z)] - /// @return The status flags for the operation. + // @return The status flags for the operation. public dtStatus getOffMeshConnectionPolyEndPoints(dtPolyRef prevRef, dtPolyRef polyRef, float[] startPos, float[] endPos) { uint salt = 0, it = 0, ip = 0; @@ -1668,7 +1668,7 @@ public static partial class Detour /// Gets the specified off-mesh connection. /// @param[in] ref The polygon reference of the off-mesh connection. - /// @return The specified off-mesh connection, or null if the polygon reference is not valid. + // @return The specified off-mesh connection, or null if the polygon reference is not valid. public dtOffMeshConnection getOffMeshConnectionByRef(dtPolyRef polyRef) { uint salt = 0, it = 0, ip = 0; @@ -1693,14 +1693,14 @@ public static partial class Detour return tile.offMeshCons[idx]; } - /// @{ - /// @name State Management + // @{ + // @name State Management /// These functions do not effect #dtTileRef or #dtPolyRef's. /// Sets the user defined flags for the specified polygon. /// @param[in] ref The polygon reference. /// @param[in] flags The new flags for the polygon. - /// @return The status flags for the operation. + // @return The status flags for the operation. public dtStatus setPolyFlags(dtPolyRef polyRef, ushort flags) { if (polyRef == 0) return DT_FAILURE; @@ -1723,7 +1723,7 @@ public static partial class Detour /// Gets the user defined flags for the specified polygon. /// @param[in] ref The polygon reference. /// @param[out] resultFlags The polygon flags. - /// @return The status flags for the operation. + // @return The status flags for the operation. public dtStatus getPolyFlags(dtPolyRef polyRef, ref ushort resultFlags) { if (polyRef == 0) return DT_FAILURE; @@ -1742,8 +1742,8 @@ public static partial class Detour /// Sets the user defined area for the specified polygon. /// @param[in] ref The polygon reference. - /// @param[in] area The new area id for the polygon. [Limit: < #DT_MAX_AREAS] - /// @return The status flags for the operation. + /// @param[in] area The new area id for the polygon. [Limit: < #DT_MAX_AREAS] + // @return The status flags for the operation. public dtStatus setPolyArea(dtPolyRef polyRef, byte area) { if (polyRef == 0) return DT_FAILURE; @@ -1763,7 +1763,7 @@ public static partial class Detour /// Gets the user defined area for the specified polygon. /// @param[in] ref The polygon reference. /// @param[out] resultArea The area id for the polygon. - /// @return The status flags for the operation. + // @return The status flags for the operation. public dtStatus getPolyArea(dtPolyRef polyRef, ref byte resultArea) { if (polyRef == 0) return DT_FAILURE; diff --git a/Source/Framework/RecastDetour/Detour/DetourNavMeshBuilder.cs b/Source/Framework/RecastDetour/Detour/DetourNavMeshBuilder.cs index 31dc64005..85dc7ede4 100644 --- a/Source/Framework/RecastDetour/Detour/DetourNavMeshBuilder.cs +++ b/Source/Framework/RecastDetour/Detour/DetourNavMeshBuilder.cs @@ -6,11 +6,11 @@ using dtPolyRef = System.UInt64; public static partial class Detour { /// The maximum number of vertices per navigation polygon. - /// @ingroup detour + // @ingroup detour public const int DT_VERTS_PER_POLYGON = 6; - /// @{ - /// @name Tile Serialization Constants + // @{ + // @name Tile Serialization Constants /// These constants are used to detect whether a navigation tile's data /// and state format is compatible with the current build. /// @@ -27,7 +27,7 @@ public static partial class Detour /// A version number used to detect compatibility of navigation tile states. public const int DT_NAVMESH_STATE_VERSION = 1; - /// @} + // @} /// A flag that indicates that an entity links to an external entity. /// (E.g. A polygon edge is a portal that links to another polygon.) @@ -40,7 +40,7 @@ public static partial class Detour public const uint DT_OFFMESH_CON_BIDIR = 1; /// The maximum number of user defined area ids. - /// @ingroup detour + // @ingroup detour public const int DT_MAX_AREAS = 64; const ushort MESH_NULL_IDX = 0xffff; @@ -79,7 +79,7 @@ public static partial class Detour /// Defines a polyogn within a dtMeshTile object. - /// @ingroup detour + // @ingroup detour public class dtPoly { /// Index to first link in linked list. (Or #DT_NULL_LINK if there is no link.) @@ -119,7 +119,7 @@ public static partial class Detour public byte vertCount; /// The bit packed area id and polygon type. - /// @note Use the structure's set and get methods to acess this value. + // @note Use the structure's set and get methods to acess this value. public byte areaAndtype; public int FromBytes(byte[] array, int start) @@ -158,7 +158,7 @@ public static partial class Detour return bytes.ToArray(); } - /// Sets the user defined area id. [Limit: < #DT_MAX_AREAS] + /// Sets the user defined area id. [Limit: < #DT_MAX_AREAS] public void setArea(byte a) { //Bitwise operators are done on ints in C# @@ -216,8 +216,8 @@ public static partial class Detour }; /// Defines a link between polygons. - /// @note This structure is rarely if ever used by the end user. - /// @see dtMeshTile + // @note This structure is rarely if ever used by the end user. + // @see dtMeshTile public class dtLink { public dtPolyRef polyRef; //< Neighbour reference. (The neighbor that is linked to.) @@ -254,8 +254,8 @@ public static partial class Detour }; /// Bounding volume node. - /// @note This structure is rarely if ever used by the end user. - /// @see dtMeshTile + // @note This structure is rarely if ever used by the end user. + // @see dtMeshTile public class dtBVNode { public ushort[] bmin = new ushort[3]; //< Minimum bounds of the node's AABB. [(x, y, z)] @@ -307,7 +307,7 @@ public static partial class Detour public ushort poly; /// Link flags. - /// @note These are not the connection's user defined flags. Those are assigned via the + // @note These are not the connection's user defined flags. Those are assigned via the /// connection's dtPoly definition. These are link flags used for internal purposes. public byte flags; @@ -352,7 +352,7 @@ public static partial class Detour /// Provides high level information related to a dtMeshTile object. - /// @ingroup detour + // @ingroup detour public class dtMeshHeader { public int magic; //< Tile magic number. (Used to identify the data format.) @@ -605,7 +605,7 @@ public static partial class Detour } } /// Defines a navigation mesh tile. - /// @ingroup detour + // @ingroup detour /* @struct dtMeshTile @par @@ -661,8 +661,8 @@ public static partial class Detour /// Configuration parameters used to define multi-tile navigation meshes. /// The values are used to allocate space during the initialization of a navigation mesh. - /// @see dtNavMesh::init() - /// @ingroup detour + // @see dtNavMesh::init() + // @ingroup detour public class dtNavMeshParams { public float[] orig = new float[3]; //< The world space origin of the navigation mesh's tile space. [(x, y, z)] @@ -687,7 +687,7 @@ public static partial class Detour }; /// Represents the source data used to build an navigation mesh tile. - /// @ingroup detour + // @ingroup detour /** @struct dtNavMeshCreateParams @par @@ -709,10 +709,10 @@ public static partial class Detour public class dtNavMeshCreateParams { - /// @name Polygon Mesh Attributes - /// Used to create the base navigation graph. - /// See #rcPolyMesh for details related to these attributes. - /// @{ + // @name Polygon Mesh Attributes + // Used to create the base navigation graph. + // See #rcPolyMesh for details related to these attributes. + // @{ public ushort[] verts; //< The polygon mesh vertices. [(x, y, z) * #vertCount] [Unit: vx] public int vertCount; //< The number vertices in the polygon mesh. [Limit: >= 3] @@ -722,10 +722,10 @@ public static partial class Detour public int polyCount; //< Number of polygons in the mesh. [Limit: >= 1] public int nvp; //< Number maximum number of vertices per polygon. [Limit: >= 3] - /// @} - /// @name Height Detail Attributes (Optional) - /// See #rcPolyMeshDetail for details related to these attributes. - /// @{ + // @} + // @name Height Detail Attributes (Optional) + // See #rcPolyMeshDetail for details related to these attributes. + // @{ public uint[] detailMeshes; //< The height detail sub-mesh data. [Size: 4 * #polyCount] public float[] detailVerts; //< The detail mesh vertices. [Size: 3 * #detailVertsCount] [Unit: wu] @@ -733,35 +733,35 @@ public static partial class Detour public byte[] detailTris; //< The detail mesh triangles. [Size: 4 * #detailTriCount] public int detailTriCount; //< The number of triangles in the detail mesh. - /// @} - /// @name Off-Mesh Connections Attributes (Optional) - /// Used to define a custom point-to-point edge within the navigation graph, an - /// off-mesh connection is a user defined traversable connection made up to two vertices, - /// at least one of which resides within a navigation mesh polygon. - /// @{ + // @} + // @name Off-Mesh Connections Attributes (Optional) + // Used to define a custom point-to-point edge within the navigation graph, an + // off-mesh connection is a user defined traversable connection made up to two vertices, + // at least one of which resides within a navigation mesh polygon. + // @{ - /// Off-mesh connection vertices. [(ax, ay, az, bx, by, bz) * #offMeshConCount] [Unit: wu] + // Off-mesh connection vertices. [(ax, ay, az, bx, by, bz) * #offMeshConCount] [Unit: wu] public float[] offMeshConVerts; - /// Off-mesh connection radii. [Size: #offMeshConCount] [Unit: wu] + // Off-mesh connection radii. [Size: #offMeshConCount] [Unit: wu] public float[] offMeshConRad; - /// User defined flags assigned to the off-mesh connections. [Size: #offMeshConCount] + // User defined flags assigned to the off-mesh connections. [Size: #offMeshConCount] public ushort[] offMeshConFlags; - /// User defined area ids assigned to the off-mesh connections. [Size: #offMeshConCount] + // User defined area ids assigned to the off-mesh connections. [Size: #offMeshConCount] public byte[] offMeshConAreas; - /// The permitted travel direction of the off-mesh connections. [Size: #offMeshConCount] - /// - /// 0 = Travel only from endpoint A to endpoint B.
- /// #DT_OFFMESH_CON_BIDIR = Bidirectional travel. + // The permitted travel direction of the off-mesh connections. [Size: #offMeshConCount] + // + // 0 = Travel only from endpoint A to endpoint B.
+ // #DT_OFFMESH_CON_BIDIR = Bidirectional travel. public byte[] offMeshConDir; - /// The user defined ids of the off-mesh connection. [Size: #offMeshConCount] + // The user defined ids of the off-mesh connection. [Size: #offMeshConCount] public uint[] offMeshConUserID; - /// The number of off-mesh connections. [Limit: >= 0] + // The number of off-mesh connections. [Limit: >= 0] public int offMeshConCount; - /// @} - /// @name Tile Attributes - /// @note The tile grid/layer data can be left at zero if the destination is a single tile mesh. - /// @{ + // @} + // @name Tile Attributes + // @note The tile grid/layer data can be left at zero if the destination is a single tile mesh. + // @{ public uint userId; //< The user defined id of the tile. public int tileX; //< The tile's x-grid location within the multi-tile destination mesh. (Along the x-axis.) @@ -770,9 +770,9 @@ public static partial class Detour public float[] bmin = new float[3]; //< The minimum bounds of the tile. [(x, y, z)] [Unit: wu] public float[] bmax = new float[3]; //< The maximum bounds of the tile. [(x, y, z)] [Unit: wu] - /// @} - /// @name General Configuration Attributes - /// @{ + // @} + // @name General Configuration Attributes + // @{ public float walkableHeight; //< The agent height. [Unit: wu] public float walkableRadius; //< The agent radius. [Unit: wu] @@ -781,10 +781,10 @@ public static partial class Detour public float ch; //< The y-axis cell height of the polygon mesh. [Limit: > 0] [Unit: wu] /// True if a bounding volume tree should be built for the tile. - /// @note The BVTree is not normally needed for layered navigation meshes. + // @note The BVTree is not normally needed for layered navigation meshes. public bool buildBvTree; - /// @} + // @} } public class BVItem @@ -1008,19 +1008,19 @@ public static partial class Detour // TODO: Better error handling. - /// @par + // @par /// /// The output data array is allocated using the detour allocator (dtAlloc()). The method /// used to free the memory will be determined by how the tile is added to the navigation /// mesh. /// - /// @see dtNavMesh, dtNavMesh::addTile() + // @see dtNavMesh, dtNavMesh::addTile() /// Builds navigation mesh tile data from the provided tile creation data. - /// @ingroup detour + // @ingroup detour /// @param[in] params Tile creation data. /// @param[out] outData The resulting tile data. /// @param[out] outDataSize The size of the tile data array. - /// @return True if the tile data was successfully created. + // @return True if the tile data was successfully created. public static bool dtCreateNavMeshData(dtNavMeshCreateParams createParams, out dtRawTileData outTile)//ref byte[] outData, ref int outDataSize) { outTile = null; @@ -1526,15 +1526,15 @@ public static partial class Detour return true; } */ - /// @par - /// - /// @warning This function assumes that the header is in the correct endianess already. - /// Call #dtNavMeshHeaderSwapEndian() first on the data if the data is expected to be in wrong endianess - /// to start with. Call #dtNavMeshHeaderSwapEndian() after the data has been swapped if converting from - /// native to foreign endianess. - /// Swaps endianess of the tile data. - /// @param[in,out] data The tile data array. - /// @param[in] dataSize The size of the data array. + // @par + // + // @warning This function assumes that the header is in the correct endianess already. + // Call #dtNavMeshHeaderSwapEndian() first on the data if the data is expected to be in wrong endianess + // to start with. Call #dtNavMeshHeaderSwapEndian() after the data has been swapped if converting from + // native to foreign endianess. + // Swaps endianess of the tile data. + // @param[in,out] data The tile data array. + // @param[in] dataSize The size of the data array. /* bool dtNavMeshDataSwapEndian(byte* data, const int dataSize) { diff --git a/Source/Framework/RecastDetour/Detour/DetourNavMeshQuery.cs b/Source/Framework/RecastDetour/Detour/DetourNavMeshQuery.cs index babef10a7..1abfcbea8 100644 --- a/Source/Framework/RecastDetour/Detour/DetourNavMeshQuery.cs +++ b/Source/Framework/RecastDetour/Detour/DetourNavMeshQuery.cs @@ -1,36 +1,36 @@ -/// @class dtQueryFilter -/// -/// The Default Implementation -/// -/// At construction: All area costs default to 1.0. All flags are included -/// and none are excluded. -/// -/// If a polygon has both an include and an exclude flag, it will be excluded. -/// -/// The way filtering works, a navigation mesh polygon must have at least one flag -/// set to ever be considered by a query. So a polygon with no flags will never -/// be considered. -/// -/// Setting the include flags to 0 will result in all polygons being excluded. -/// -/// Custom Implementations -/// -/// DT_VIRTUAL_QUERYFILTER must be defined in order to extend this class. -/// -/// Implement a custom query filter by overriding the virtual passFilter() -/// and getCost() functions. If this is done, both functions should be as -/// fast as possible. Use cached local copies of data rather than accessing -/// your own objects where possible. -/// -/// Custom implementations do not need to adhere to the flags or cost logic -/// used by the default implementation. -/// -/// In order for A* searches to work properly, the cost should be proportional to -/// the travel distance. Implementing a cost modifier less than 1.0 is likely -/// to lead to problems during pathfinding. -/// -/// @see dtNavMeshQuery -/// +// @class dtQueryFilter +// +// The Default Implementation +// +// At construction: All area costs default to 1.0. All flags are included +// and none are excluded. +// +// If a polygon has both an include and an exclude flag, it will be excluded. +// +// The way filtering works, a navigation mesh polygon must have at least one flag +// set to ever be considered by a query. So a polygon with no flags will never +// be considered. +// +// Setting the include flags to 0 will result in all polygons being excluded. +// +// Custom Implementations +// +// DT_VIRTUAL_QUERYFILTER must be defined in order to extend this class. +// +// Implement a custom query filter by overriding the virtual passFilter() +// and getCost() functions. If this is done, both functions should be as +// fast as possible. Use cached local copies of data rather than accessing +// your own objects where possible. +// +// Custom implementations do not need to adhere to the flags or cost logic +// used by the default implementation. +// +// In order for A* searches to work properly, the cost should be proportional to +// the travel distance. Implementing a cost modifier less than 1.0 is likely +// to lead to problems during pathfinding. +// +// @see dtNavMeshQuery +// using System; using System.Diagnostics; @@ -49,7 +49,7 @@ public static partial class Detour const float H_SCALE = 0.999f; // Search heuristic scale. /// Defines polygon filtering and traversal costs for navigation mesh query operations. - /// @ingroup detour + // @ingroup detour public class dtQueryFilter { public float[] m_areaCost = new float[DT_MAX_AREAS]; //< Cost per area type. (Used by default implementation.) @@ -91,12 +91,12 @@ public static partial class Detour return dtVdist(pa, pb) * m_areaCost[curPoly.getArea()]; } - /// @name Getters and setters for the default implementation data. + // @name Getters and setters for the default implementation data. ///@{ /// Returns the traversal cost of the area. /// @param[in] i The id of the area. - /// @returns The traversal cost of the area. + // @returns The traversal cost of the area. public float getAreaCost(int i) { return m_areaCost[i]; @@ -119,7 +119,7 @@ public static partial class Detour } /// Sets the include flags for the filter. - /// @param[in] flags The new flags. + // @param[in] flags The new flags. public void setIncludeFlags(ushort flags) { m_includeFlags = flags; @@ -134,7 +134,7 @@ public static partial class Detour } /// Sets the exclude flags for the filter. - /// @param[in] flags The new flags. + // @param[in] flags The new flags. public void setExcludeFlags(ushort flags) { m_excludeFlags = flags; @@ -143,7 +143,7 @@ public static partial class Detour ////////////////////////////////////////////////////////////////////////////////////////// - /// @class dtNavMeshQuery + // @class dtNavMeshQuery /// Provides the ability to perform pathfinding related queries against /// a navigation mesh. /// @@ -159,8 +159,8 @@ public static partial class Detour /// considered impassable. A @e portal is a passable segment between polygons. /// A portal may be treated as a wall based on the dtQueryFilter used for a query. /// - /// @see dtNavMesh, dtQueryFilter, #dtAllocNavMeshQuery(), #dtAllocNavMeshQuery() - /// @ingroup detour + // @see dtNavMesh, dtQueryFilter, #dtAllocNavMeshQuery(), #dtAllocNavMeshQuery() + // @ingroup detour public class dtNavMeshQuery { private dtNavMesh m_nav; //< Pointer to navmesh data. @@ -201,7 +201,7 @@ public static partial class Detour { } - /// @par + // @par /// /// Must be the first function called after construction, before other /// functions are used. @@ -209,8 +209,8 @@ public static partial class Detour /// This function can be used multiple times. /// Initializes the query object. /// @param[in] nav Pointer to the dtNavMesh object to use for all queries. - /// @param[in] maxNodes Maximum number of search nodes. [Limits: 0 < value <= 65536] - /// @returns The status flags for the query. + /// @param[in] maxNodes Maximum number of search nodes. [Limits: 0 < value <= 65536] + // @returns The status flags for the query. public dtStatus init(dtNavMesh nav, int maxNodes) { m_nav = nav; @@ -264,7 +264,7 @@ public static partial class Detour return DT_SUCCESS; } - /// @name Standard Pathfinding Functions + // @name Standard Pathfinding Functions public delegate float randomFloatGenerator(); @@ -274,7 +274,7 @@ public static partial class Detour /// @param[in] frand Function returning a random number [0..1). /// @param[out] randomRef The reference id of the random location. /// @param[out] randomPt The random location. - /// @returns The status flags for the query. + // @returns The status flags for the query. public dtStatus findRandomPoint(dtQueryFilter filter, randomFloatGenerator frand, ref dtPolyRef randomRef, ref float[] randomPt) { Debug.Assert(m_nav != null); @@ -377,7 +377,7 @@ public static partial class Detour /// @param[in] frand Function returning a random number [0..1). /// @param[out] randomRef The reference id of the random location. /// @param[out] randomPt The random location. [(x, y, z)] - /// @returns The status flags for the query. + // @returns The status flags for the query. public dtStatus findRandomPointAroundCircle(dtPolyRef startRef, float[] centerPos, float radius, dtQueryFilter filter, randomFloatGenerator frand, ref dtPolyRef randomRef, ref float[] randomPt) { Debug.Assert(m_nav != null); @@ -574,12 +574,12 @@ public static partial class Detour /// @param[in] pos The position to check. [(x, y, z)] /// @param[out] closest The closest point on the polygon. [(x, y, z)] /// @param[out] posOverPoly True of the position is over the polygon. - /// @returns The status flags for the query. - /// @par + // @returns The status flags for the query. + // @par /// /// Uses the detail polygons to find the surface height. (Most accurate.) /// - /// @p pos does not have to be within the bounds of the polygon or navigation mesh. + // @p pos does not have to be within the bounds of the polygon or navigation mesh. /// /// See closestPointOnPolyBoundary() for a limited but faster option. /// @@ -693,8 +693,8 @@ public static partial class Detour /// @param[in] ref The reference id to the polygon. /// @param[in] pos The position to check. [(x, y, z)] /// @param[out] closest The closest point. [(x, y, z)] - /// @returns The status flags for the query. - /// @par + // @returns The status flags for the query. + // @par /// /// Much faster than closestPointOnPoly(). /// @@ -703,7 +703,7 @@ public static partial class Detour /// /// The height of @p closest will be the polygon boundary. The height detail is not used. /// - /// @p pos does not have to be within the bounds of the polybon or the navigation mesh. + // @p pos does not have to be within the bounds of the polybon or the navigation mesh. /// public dtStatus closestPointOnPolyBoundary(dtPolyRef polyRef, float[] pos, float[] closest) { @@ -758,8 +758,8 @@ public static partial class Detour /// @param[in] ref The reference id of the polygon. /// @param[in] pos A position within the xz-bounds of the polygon. [(x, y, z)] /// @param[out] height The height at the surface of the polygon. - /// @returns The status flags for the query. - /// @par + // @returns The status flags for the query. + // @par /// /// Will return #DT_FAILURE if the provided position is outside the xz-bounds /// of the polygon. @@ -827,8 +827,8 @@ public static partial class Detour return DT_FAILURE | DT_INVALID_PARAM; } - /// @} - /// @name Local Query Functions + // @} + // @name Local Query Functions ///@{ /// Finds the polygon nearest to the specified center point. @@ -837,14 +837,14 @@ public static partial class Detour /// @param[in] filter The polygon filter to apply to the query. /// @param[out] nearestRef The reference id of the nearest polygon. /// @param[out] nearestPt The nearest point on the polygon. [opt] [(x, y, z)] - /// @returns The status flags for the query. - /// @par + // @returns The status flags for the query. + // @par /// - /// @note If the search box does not intersect any polygons the search will + // @note If the search box does not intersect any polygons the search will /// return #DT_SUCCESS, but @p nearestRef will be zero. So if in doubt, check - /// @p nearestRef before using @p nearestPt. + // @p nearestRef before using @p nearestPt. /// - /// @warning This function is not suitable for large area searches. If the search + // @warning This function is not suitable for large area searches. If the search /// extents overlaps more than 128 polygons it may return an invalid result. /// public dtStatus findNearestPoly(float[] center, float[] extents, dtQueryFilter filter, ref dtPolyRef nearestRef, ref float[] nearestPt) @@ -1014,11 +1014,11 @@ public static partial class Detour /// @param[out] polys The reference ids of the polygons that overlap the query box. /// @param[out] polyCount The number of polygons in the search result. /// @param[in] maxPolys The maximum number of polygons the search result can hold. - /// @returns The status flags for the query. - /// @par + // @returns The status flags for the query. + // @par /// /// If no polygons are found, the function will return #DT_SUCCESS with a - /// @p polyCount of zero. + // @p polyCount of zero. /// /// If @p polys is too small to hold the entire result set, then the array will /// be filled to capacity. The method of choosing which polygons from the @@ -1073,7 +1073,7 @@ public static partial class Detour /// [(polyRef) * @p pathCount] /// @param[out] pathCount The number of polygons returned in the @p path array. /// @param[in] maxPath The maximum number of polygons the @p path array can hold. [Limit: >= 1] - /// @par + // @par /// /// If the end polygon cannot be reached through the navigation graph, /// the last polygon in the path will be the nearest the end polygon. @@ -1298,7 +1298,7 @@ public static partial class Detour } ///@} - /// @name Sliced Pathfinding Functions + // @name Sliced Pathfinding Functions /// Common use case: /// -# Call initSlicedFindPath() to initialize the sliced path query. /// -# Call updateSlicedFindPath() until it returns complete. @@ -1311,10 +1311,10 @@ public static partial class Detour /// @param[in] startPos A position within the start polygon. [(x, y, z)] /// @param[in] endPos A position within the end polygon. [(x, y, z)] /// @param[in] filter The polygon filter to apply to the query. - /// @returns The status flags for the query. - /// @par + // @returns The status flags for the query. + // @par /// - /// @warning Calling any non-slice methods before calling finalizeSlicedFindPath() + // @warning Calling any non-slice methods before calling finalizeSlicedFindPath() /// or finalizeSlicedFindPathPartial() may result in corrupted data! /// /// The @p filter pointer is stored and used for the duration of the sliced @@ -1371,7 +1371,7 @@ public static partial class Detour /// Updates an in-progress sliced path query. /// @param[in] maxIter The maximum number of iterations to perform. /// @param[out] doneIters The actual number of iterations completed. [opt] - /// @returns The status flags for the query. + // @returns The status flags for the query. public dtStatus updateSlicedFindPath(int maxIter, ref int doneIters) { if (!dtStatusInProgress(m_query.status)) @@ -1557,7 +1557,7 @@ public static partial class Detour /// [(polyRef) * @p pathCount] /// @param[out] pathCount The number of polygons returned in the @p path array. /// @param[in] maxPath The max number of polygons the path array can hold. [Limit: >= 1] - /// @returns The status flags for the query. + // @returns The status flags for the query. public dtStatus finalizeSlicedFindPath(dtPolyRef[] path, ref int pathCount, int maxPath) { pathCount = 0; @@ -1630,7 +1630,7 @@ public static partial class Detour /// [(polyRef) * @p pathCount] /// @param[out] pathCount The number of polygons returned in the @p path array. /// @param[in] maxPath The max number of polygons the @p path array can hold. [Limit: >= 1] - /// @returns The status flags for the query. + // @returns The status flags for the query. public dtStatus finalizeSlicedFindPathPartial(dtPolyRef[] existing, int existingSize, dtPolyRef[] path, ref int pathCount, int maxPath) { pathCount = 0; @@ -1801,8 +1801,8 @@ public static partial class Detour /// @param[out] straightPathCount The number of points in the straight path. /// @param[in] maxStraightPath The maximum number of points the straight path arrays can hold. [Limit: > 0] /// @param[in] options Query options. (see: #dtStraightPathOptions) - /// @returns The status flags for the query. - /// @par + // @returns The status flags for the query. + // @par /// /// This method peforms what is often called 'string pulling'. /// @@ -2050,17 +2050,17 @@ public static partial class Detour /// @param[out] visited The reference ids of the polygons visited during the move. /// @param[out] visitedCount The number of polygons visited during the move. /// @param[in] maxVisitedSize The maximum number of polygons the @p visited array can hold. - /// @returns The status flags for the query. - /// @par + // @returns The status flags for the query. + // @par /// /// This method is optimized for small delta movement and a small number of /// polygons. If used for too great a distance, the result set will form an /// incomplete path. /// - /// @p resultPos will equal the @p endPos if the end is reached. + // @p resultPos will equal the @p endPos if the end is reached. /// Otherwise the closest reachable position will be returned. /// - /// @p resultPos is not projected onto the surface of the navigation + // @p resultPos is not projected onto the surface of the navigation /// mesh. Use #getPolyHeight if this is needed. /// /// This method treats the end position in the same manner as @@ -2404,8 +2404,8 @@ public static partial class Detour /// @param[out] path The reference ids of the visited polygons. [opt] /// @param[out] pathCount The number of visited polygons. [opt] /// @param[in] maxPath The maximum number of polygons the @p path array can hold. - /// @returns The status flags for the query. - /// @par + // @returns The status flags for the query. + // @par /// /// This method is meant to be used for quick, short distance checks. /// @@ -2421,12 +2421,12 @@ public static partial class Detour /// If the hit parameter is zero, then the start position is on the wall that /// was hit and the value of @p hitNormal is undefined. /// - /// If 0 < t < 1.0 then the following applies: + /// If 0 < t < 1.0 then the following applies: /// - /// @code + // @code /// distanceToHitBorder = distanceToEndPosition * t /// hitPoint = startPos + (endPos - startPos) * t - /// @endcode + // @endcode /// /// Use Case Restriction /// @@ -2628,8 +2628,8 @@ public static partial class Detour } ///@} - /// @name Dijkstra Search Functions - /// @{ + // @name Dijkstra Search Functions + // @{ /// Finds the polygons along the navigation graph that touch the specified circle. /// @param[in] startRef The reference id of the polygon where the search starts. @@ -2642,8 +2642,8 @@ public static partial class Detour /// @param[out] resultCost The search cost from @p centerPos to the polygon. [opt] /// @param[out] resultCount The number of polygons found. [opt] /// @param[in] maxResult The maximum number of polygons the result arrays can hold. - /// @returns The status flags for the query. - /// @par + // @returns The status flags for the query. + // @par /// /// At least one result array must be provided. /// @@ -2838,8 +2838,8 @@ public static partial class Detour /// @param[out] resultCost The search cost from the centroid point to the polygon. [opt] /// @param[out] resultCount The number of polygons found. /// @param[in] maxResult The maximum number of polygons the result arrays can hold. - /// @returns The status flags for the query. - /// @par + // @returns The status flags for the query. + // @par /// /// The order of the result set is from least to highest cost. /// @@ -3031,8 +3031,8 @@ public static partial class Detour /// Zero if a result polygon has no parent. [opt] /// @param[out] resultCount The number of polygons found. /// @param[in] maxResult The maximum number of polygons the result arrays can hold. - /// @returns The status flags for the query. - /// @par + // @returns The status flags for the query. + // @par /// /// This method is optimized for a small search radius and small number of result /// polygons. @@ -3276,8 +3276,8 @@ public static partial class Detour /// Or zero if the segment is a wall. [opt] [(parentRef) * @p segmentCount] /// @param[out] segmentCount The number of segments returned. /// @param[in] maxSegments The maximum number of segments the result arrays can hold. - /// @returns The status flags for the query. - /// @par + // @returns The status flags for the query. + // @par /// /// If the @p segmentRefs parameter is provided, then all polygon segments will be returned. /// Otherwise only the wall segments are returned. @@ -3443,12 +3443,12 @@ public static partial class Detour /// @param[out] hitPos The nearest position on the wall that was hit. [(x, y, z)] /// @param[out] hitNormal The normalized ray formed from the wall point to the /// source point. [(x, y, z)] - /// @returns The status flags for the query. - /// @par + // @returns The status flags for the query. + // @par /// - /// @p hitPos is not adjusted using the height detail data. + // @p hitPos is not adjusted using the height detail data. /// - /// @p hitDist will equal the search radius if there is no wall within the + // @p hitDist will equal the search radius if there is no wall within the /// radius. In this case the values of @p hitPos and @p hitNormal are /// undefined. /// @@ -3643,9 +3643,9 @@ public static partial class Detour return status; } - /// @} - /// @name Miscellaneous Functions - /// @{ + // @} + // @name Miscellaneous Functions + // @{ /// Returns true if the polygon reference is valid and passes the filter restrictions. /// @param[in] ref The polygon reference to check. @@ -3666,8 +3666,8 @@ public static partial class Detour /// Returns true if the polygon reference is in the closed list. /// @param[in] ref The reference id of the polygon to check. - /// @returns True if the polygon is in closed list. - /// @par + // @returns True if the polygon is in closed list. + // @par /// /// The closed list is the list of polygons that were fully evaluated during /// the last navigation graph search. (A* or Dijkstra) @@ -3680,7 +3680,7 @@ public static partial class Detour } /// Gets the navigation mesh the query object is using. - /// @return The navigation mesh the query object is using. + // @return The navigation mesh the query object is using. public dtNavMesh getAttachedNavMesh() { return m_nav; diff --git a/Source/Framework/Serialization/Json.cs b/Source/Framework/Serialization/Json.cs index 5fdcbae2e..b6338608b 100644 --- a/Source/Framework/Serialization/Json.cs +++ b/Source/Framework/Serialization/Json.cs @@ -51,7 +51,7 @@ namespace Framework.Serialization return CreateObject(Encoding.UTF8.GetBytes(split ? jsonData.Split(new[] { ':' }, 2)[1] : jsonData)); } - public static T CreateObject(byte[] jsonData) => (T)CreateObject(new MemoryStream(jsonData)); + public static T CreateObject(byte[] jsonData) => CreateObject(new MemoryStream(jsonData)); public static object CreateObject(Stream jsonData, Type type) { diff --git a/Source/Framework/Util/CollectionExtensions.cs b/Source/Framework/Util/CollectionExtensions.cs index 22d41a2da..69fd81e38 100644 --- a/Source/Framework/Util/CollectionExtensions.cs +++ b/Source/Framework/Util/CollectionExtensions.cs @@ -66,6 +66,9 @@ namespace System.Collections.Generic } public static KeyValuePair Find(this IDictionary dict, TKey key) { + if (!dict.ContainsKey(key)) + return default(KeyValuePair); + return new KeyValuePair(key, dict[key]); } @@ -113,17 +116,17 @@ namespace System.Collections.Generic } } - public static void RandomResize(this ICollection list, Predicate predicate, uint size) + public static void RandomResize(this List list, Predicate predicate, uint size) { - List listCopy = new List(); - foreach (var obj in list) - if (predicate(obj)) - listCopy.Add(obj); + for (var i = 0; i < list.Count; ++i) + { + var obj = list[i]; + if (!predicate(obj)) + list.Remove(obj); + } if (size != 0) - listCopy.Resize(size); - - list = listCopy; + list.Resize(size); } public static T SelectRandom(this IEnumerable source) diff --git a/Source/Framework/Util/Extensions.cs b/Source/Framework/Util/Extensions.cs index 81c39d398..b6468abed 100644 --- a/Source/Framework/Util/Extensions.cs +++ b/Source/Framework/Util/Extensions.cs @@ -72,7 +72,7 @@ namespace System for (int i = 0; i < length; i++) { - int randValue = -1; + int randValue; do { @@ -128,7 +128,7 @@ namespace System public static BigInteger ToBigInteger(this T value, bool isBigEndian = false) { - var ret = BigInteger.Zero; + BigInteger ret; switch (typeof(T).Name) { diff --git a/Source/Framework/Util/RandomHelper.cs b/Source/Framework/Util/RandomHelper.cs index 53874c3e9..300c9c0dd 100644 --- a/Source/Framework/Util/RandomHelper.cs +++ b/Source/Framework/Util/RandomHelper.cs @@ -100,9 +100,9 @@ public class RandomHelper public static T RAND(params T[] args) { - int rand = IRand(0, args.Length - 1); + int randIndex = IRand(0, args.Length - 1); - return args[rand]; + return args[randIndex]; } } diff --git a/Source/Game/AI/CoreAI/CombatAI.cs b/Source/Game/AI/CoreAI/CombatAI.cs index 8b0cd1106..811831bde 100644 --- a/Source/Game/AI/CoreAI/CombatAI.cs +++ b/Source/Game/AI/CoreAI/CombatAI.cs @@ -241,7 +241,7 @@ namespace Game.AI } public override bool CanAIAttack(Unit victim) { - /// todo use one function to replace it + // todo use one function to replace it if (!me.IsWithinCombatRange(me.GetVictim(), me.m_CombatDistance) || (m_minRange != 0 && me.IsWithinCombatRange(me.GetVictim(), m_minRange))) return false; diff --git a/Source/Game/AI/CoreAI/PetAI.cs b/Source/Game/AI/CoreAI/PetAI.cs index 9738ef470..ce991919a 100644 --- a/Source/Game/AI/CoreAI/PetAI.cs +++ b/Source/Game/AI/CoreAI/PetAI.cs @@ -546,7 +546,7 @@ namespace Game.AI if (me.GetVictim() && me.GetVictim() != victim) { // Check if our owner selected this target and clicked "attack" - Unit ownerTarget = null; + Unit ownerTarget; Player owner = me.GetCharmerOrOwner().ToPlayer(); if (owner) ownerTarget = owner.GetSelectedUnit(); diff --git a/Source/Game/AI/CoreAI/TotemAI.cs b/Source/Game/AI/CoreAI/TotemAI.cs index 31665b253..cbc195f3e 100644 --- a/Source/Game/AI/CoreAI/TotemAI.cs +++ b/Source/Game/AI/CoreAI/TotemAI.cs @@ -57,7 +57,6 @@ namespace Game.AI if (victim == null || !victim.isTargetableForAttack() || !me.IsWithinDistInMap(victim, max_range) || me.IsFriendlyTo(victim) || !me.CanSeeOrDetect(victim)) { - victim = null; var u_check = new NearestAttackableUnitInObjectRangeCheck(me, me.GetCharmerOrOwnerOrSelf(), max_range); var checker = new UnitLastSearcher(me, u_check); Cell.VisitAllObjects(me, checker, max_range); diff --git a/Source/Game/AI/ScriptedAI/ScriptedAI.cs b/Source/Game/AI/ScriptedAI/ScriptedAI.cs index 40f56e7df..5938ee193 100644 --- a/Source/Game/AI/ScriptedAI/ScriptedAI.cs +++ b/Source/Game/AI/ScriptedAI/ScriptedAI.cs @@ -133,12 +133,10 @@ namespace Game.AI uint spellCount = 0; - SpellInfo tempSpell = null; - //Check if each spell is viable(set it to null if not) for (uint i = 0; i < SharedConst.MaxCreatureSpells; i++) { - tempSpell = Global.SpellMgr.GetSpellInfo(me.m_spells[i]); + SpellInfo tempSpell = Global.SpellMgr.GetSpellInfo(me.m_spells[i]); //This spell doesn't exist if (tempSpell == null) diff --git a/Source/Game/AI/ScriptedAI/ScriptedFollowerAI.cs b/Source/Game/AI/ScriptedAI/ScriptedFollowerAI.cs index 5c0cce917..01ddfb382 100644 --- a/Source/Game/AI/ScriptedAI/ScriptedFollowerAI.cs +++ b/Source/Game/AI/ScriptedAI/ScriptedFollowerAI.cs @@ -142,7 +142,7 @@ namespace Game.AI if (!HasFollowState(eFollowState.Inprogress) || m_uiLeaderGUID.IsEmpty() || m_pQuestForFollow == null) return; - /// @todo need a better check for quests with time limit. + // @todo need a better check for quests with time limit. Player player = GetLeaderForFollower(); if (player) { diff --git a/Source/Game/AI/SmartScripts/SmartAIManager.cs b/Source/Game/AI/SmartScripts/SmartAIManager.cs index 390c3863c..87bd92f22 100644 --- a/Source/Game/AI/SmartScripts/SmartAIManager.cs +++ b/Source/Game/AI/SmartScripts/SmartAIManager.cs @@ -1255,7 +1255,7 @@ namespace Game.AI if (e.GetScriptType() != SmartScriptType.Creature) return true; - uint entry = 0; + uint entry; if (e.GetEventType() == SmartEvents.TextOver) { entry = e.Event.textOver.creatureEntry; diff --git a/Source/Game/AI/SmartScripts/SmartScript.cs b/Source/Game/AI/SmartScripts/SmartScript.cs index 87d42c013..f46b3f59f 100644 --- a/Source/Game/AI/SmartScripts/SmartScript.cs +++ b/Source/Game/AI/SmartScripts/SmartScript.cs @@ -3272,7 +3272,7 @@ namespace Game.AI if (me == null || !me.IsInCombat()) return; - List _targets = null; + List _targets; switch (e.GetTargetType()) { diff --git a/Source/Game/Achievements/AchievementManager.cs b/Source/Game/Achievements/AchievementManager.cs index 26823bc3d..eedbf13e0 100644 --- a/Source/Game/Achievements/AchievementManager.cs +++ b/Source/Game/Achievements/AchievementManager.cs @@ -180,13 +180,13 @@ namespace Game.Achievements public virtual void CompletedAchievement(AchievementRecord entry, Player referencePlayer) { } - public Func, AchievementRecord> VisibleAchievementCheck = new Func, AchievementRecord>(value => + public Func, AchievementRecord> VisibleAchievementCheck = value => { AchievementRecord achievement = CliDB.AchievementStorage.LookupByKey(value.Key); if (achievement != null && !achievement.Flags.HasAnyFlag(AchievementFlags.Hidden)) return achievement; return null; - }); + }; protected Dictionary _completedAchievements = new Dictionary(); protected uint _achievementPoints; @@ -1045,7 +1045,7 @@ namespace Game.Achievements public bool IsRealmCompleted(AchievementRecord achievement) { var time = _allCompletedAchievements.LookupByKey(achievement.Id); - if (time == null) + if (time == default(DateTime)) return false; if (time == DateTime.MinValue) diff --git a/Source/Game/BattleFields/Zones/WinterGrasp.cs b/Source/Game/BattleFields/Zones/WinterGrasp.cs index a0a85d23f..4467d7039 100644 --- a/Source/Game/BattleFields/Zones/WinterGrasp.cs +++ b/Source/Game/BattleFields/Zones/WinterGrasp.cs @@ -694,7 +694,7 @@ namespace Game.BattleFields public override void OnPlayerLeaveWar(Player player) { - // Remove all aura from WG /// @todo false we can go out of this zone on retail and keep Rank buff, remove on end of WG + // Remove all aura from WG // @todo false we can go out of this zone on retail and keep Rank buff, remove on end of WG if (!player.GetSession().PlayerLogout()) { Creature vehicle = player.GetVehicleCreatureBase(); diff --git a/Source/Game/BattleFields/Zones/WinterGraspConst.cs b/Source/Game/BattleFields/Zones/WinterGraspConst.cs index 50e60f31b..440398abc 100644 --- a/Source/Game/BattleFields/Zones/WinterGraspConst.cs +++ b/Source/Game/BattleFields/Zones/WinterGraspConst.cs @@ -380,21 +380,21 @@ namespace Game.BattleFields struct WGAchievements { public const uint WinWg = 1717; - public const uint WinWg100 = 1718; /// @Todo: Has To Be Implemented - public const uint WgGnomeslaughter = 1723; /// @Todo: Has To Be Implemented + public const uint WinWg100 = 1718; // @Todo: Has To Be Implemented + public const uint WgGnomeslaughter = 1723; // @Todo: Has To Be Implemented public const uint WgTowerDestroy = 1727; - public const uint DestructionDerbyA = 1737; /// @Todo: Has To Be Implemented - public const uint WgTowerCannonKill = 1751; /// @Todo: Has To Be Implemented - public const uint WgMasterA = 1752; /// @Todo: Has To Be Implemented + public const uint DestructionDerbyA = 1737; // @Todo: Has To Be Implemented + public const uint WgTowerCannonKill = 1751; // @Todo: Has To Be Implemented + public const uint WgMasterA = 1752; // @Todo: Has To Be Implemented public const uint WinWgTimer10 = 1755; - public const uint StoneKeeper50 = 2085; /// @Todo: Has To Be Implemented - public const uint StoneKeeper100 = 2086; /// @Todo: Has To Be Implemented - public const uint StoneKeeper250 = 2087; /// @Todo: Has To Be Implemented - public const uint StoneKeeper500 = 2088; /// @Todo: Has To Be Implemented - public const uint StoneKeeper1000 = 2089; /// @Todo: Has To Be Implemented - public const uint WgRanger = 2199; /// @Todo: Has To Be Implemented - public const uint DestructionDerbyH = 2476; /// @Todo: Has To Be Implemented - public const uint WgMasterH = 2776; /// @Todo: Has To Be Implemented + public const uint StoneKeeper50 = 2085; // @Todo: Has To Be Implemented + public const uint StoneKeeper100 = 2086; // @Todo: Has To Be Implemented + public const uint StoneKeeper250 = 2087; // @Todo: Has To Be Implemented + public const uint StoneKeeper500 = 2088; // @Todo: Has To Be Implemented + public const uint StoneKeeper1000 = 2089; // @Todo: Has To Be Implemented + public const uint WgRanger = 2199; // @Todo: Has To Be Implemented + public const uint DestructionDerbyH = 2476; // @Todo: Has To Be Implemented + public const uint WgMasterH = 2776; // @Todo: Has To Be Implemented } struct WGSpells @@ -693,7 +693,7 @@ namespace Game.BattleFields public uint towerEntry; // Gameobject id of tower public WintergraspGameObjectData[] GameObject = new WintergraspGameObjectData[6]; // Gameobject position and entry (Horde/Alliance) - // Creature: Turrets and Guard /// @todo: Killed on Tower destruction ? Tower damage ? Requires confirming + // Creature: Turrets and Guard // @todo: Killed on Tower destruction ? Tower damage ? Requires confirming public WintergraspObjectPositionData[] CreatureBottom = new WintergraspObjectPositionData[9]; } diff --git a/Source/Game/BattleGrounds/BattleGround.cs b/Source/Game/BattleGrounds/BattleGround.cs index 8b22df28c..2252c6ee4 100644 --- a/Source/Game/BattleGrounds/BattleGround.cs +++ b/Source/Game/BattleGrounds/BattleGround.cs @@ -227,9 +227,9 @@ namespace Game.BattleGrounds { if (GetReviveQueueSize() != 0) { + Creature sh = null; foreach (var pair in m_ReviveQueue) { - Creature sh = null; Player player = Global.ObjAccessor.FindPlayer(pair.Value); if (!player) continue; diff --git a/Source/Game/BattleGrounds/Zones/EyeofStorm.cs b/Source/Game/BattleGrounds/Zones/EyeofStorm.cs index 6a1d8e41d..7c3dfaefa 100644 --- a/Source/Game/BattleGrounds/Zones/EyeofStorm.cs +++ b/Source/Game/BattleGrounds/Zones/EyeofStorm.cs @@ -282,7 +282,7 @@ namespace Game.BattleGrounds.Zones EventTeamLostPoint(player, point); } - /// @workaround The original AreaTrigger is covered by a bigger one and not triggered on client side. + // @workaround The original AreaTrigger is covered by a bigger one and not triggered on client side. if (point == EotSPoints.FelReaver && m_PointOwnedByTeam[point] == player.GetTeam()) if (m_FlagState != 0 && GetFlagPickerGUID() == player.GetGUID()) if (player.GetDistance(2044.0f, 1729.729f, 1190.03f) < 3.0f) diff --git a/Source/Game/Chat/Channels/Channel.cs b/Source/Game/Chat/Channels/Channel.cs index 4a9d95221..0ea000856 100644 --- a/Source/Game/Chat/Channels/Channel.cs +++ b/Source/Game/Chat/Channels/Channel.cs @@ -574,7 +574,7 @@ namespace Game.Chat Log.outDebug(LogFilter.ChatSystem, "SMSG_CHANNEL_LIST {0} Channel: {1}", player.GetSession().GetPlayerInfo(), channelName); ChannelListResponse list = new ChannelListResponse(); - list.Display = true; /// always true? + list.Display = true; // always true? list.Channel = channelName; list.ChannelFlags = GetFlags(); diff --git a/Source/Game/Chat/CommandHandler.cs b/Source/Game/Chat/CommandHandler.cs index 893f8b8a7..a8e4a0c47 100644 --- a/Source/Game/Chat/CommandHandler.cs +++ b/Source/Game/Chat/CommandHandler.cs @@ -52,11 +52,11 @@ namespace Game.Chat if (text.Length < 2) return false; - /// ignore messages staring from many dots. + // ignore messages staring from many dots. if ((text[0] == '.' && text[1] == '.') || (text[0] == '!' && text[1] == '!')) return false; - /// skip first . or ! (in console allowed use command with . and ! and without its) + // skip first . or ! (in console allowed use command with . and ! and without its) if (text[0] == '!' || text[0] == '.') text = text.Substring(1); diff --git a/Source/Game/Chat/Commands/AccountCommands.cs b/Source/Game/Chat/Commands/AccountCommands.cs index a863fafba..98578d073 100644 --- a/Source/Game/Chat/Commands/AccountCommands.cs +++ b/Source/Game/Chat/Commands/AccountCommands.cs @@ -47,7 +47,7 @@ namespace Game.Chat "Unknown security level: Notify technician for details.")); // RBAC required display - is not displayed for console - if (pwConfig == 2 && session != null && hasRBAC) + if (pwConfig == 2 && hasRBAC) handler.SendSysMessage(CypherStrings.RbacEmailRequired); // Email display if sufficient rights @@ -635,8 +635,8 @@ namespace Game.Chat return false; } - /// can set email only for target with less security - /// This also restricts setting handler's own email. + // can set email only for target with less security + // This also restricts setting handler's own email. if (handler.HasLowerSecurityAccount(null, targetAccountId, true)) return false; @@ -696,8 +696,8 @@ namespace Game.Chat return false; } - /// can set email only for target with less security - /// This also restricts setting handler's own email. + // can set email only for target with less security + // This also restricts setting handler's own email. if (handler.HasLowerSecurityAccount(null, targetAccountId, true)) return false; diff --git a/Source/Game/Chat/Commands/BanCommands.cs b/Source/Game/Chat/Commands/BanCommands.cs index dc3b98e2a..c4ed161d6 100644 --- a/Source/Game/Chat/Commands/BanCommands.cs +++ b/Source/Game/Chat/Commands/BanCommands.cs @@ -146,7 +146,7 @@ namespace Game.Chat.Commands if (!uint.TryParse(durationStr, out uint tempValue) || tempValue > 0) { if (WorldConfig.GetBoolValue(WorldCfg.ShowBanInWorld)) - Global.WorldMgr.SendWorldText(CypherStrings.BanAccountYoubannedmessageWorld, author, nameOrIP, Time.secsToTimeString(Time.TimeStringToSecs(durationStr)).ToString(), reasonStr); + Global.WorldMgr.SendWorldText(CypherStrings.BanAccountYoubannedmessageWorld, author, nameOrIP, Time.secsToTimeString(Time.TimeStringToSecs(durationStr)), reasonStr); else handler.SendSysMessage(CypherStrings.BanYoubanned, nameOrIP, Time.secsToTimeString(Time.TimeStringToSecs(durationStr), true), reasonStr); } diff --git a/Source/Game/Chat/Commands/CharacterCommands.cs b/Source/Game/Chat/Commands/CharacterCommands.cs index 6ae21825a..a46858100 100644 --- a/Source/Game/Chat/Commands/CharacterCommands.cs +++ b/Source/Game/Chat/Commands/CharacterCommands.cs @@ -306,7 +306,7 @@ namespace Game.Chat stmt.AddValue(0, AtLoginFlags.ChangeRace); if (target) { - /// @todo add text into database + // @todo add text into database handler.SendSysMessage(CypherStrings.CustomizePlayer, handler.GetNameLink(target)); target.SetAtLoginFlag(AtLoginFlags.ChangeRace); stmt.AddValue(1, target.GetGUID().GetCounter()); @@ -314,7 +314,7 @@ namespace Game.Chat else { string oldNameLink = handler.playerLink(targetName); - /// @todo add text into database + // @todo add text into database handler.SendSysMessage(CypherStrings.CustomizePlayerGuid, oldNameLink, targetGuid.ToString()); stmt.AddValue(1, targetGuid.GetCounter()); } diff --git a/Source/Game/Chat/Commands/DebugCommands.cs b/Source/Game/Chat/Commands/DebugCommands.cs index d2f4b38f5..ecc3b55dd 100644 --- a/Source/Game/Chat/Commands/DebugCommands.cs +++ b/Source/Game/Chat/Commands/DebugCommands.cs @@ -619,7 +619,7 @@ namespace Game.Chat return false; target.SetUnitMovementFlags((MovementFlag)moveFlags); - /// @fixme: port master's HandleDebugMoveflagsCommand; flags need different handling + // @fixme: port master's HandleDebugMoveflagsCommand; flags need different handling if (!string.IsNullOrEmpty(mask2)) { diff --git a/Source/Game/Chat/Commands/GameObjectCommands.cs b/Source/Game/Chat/Commands/GameObjectCommands.cs index fd79413e5..35b1f8c49 100644 --- a/Source/Game/Chat/Commands/GameObjectCommands.cs +++ b/Source/Game/Chat/Commands/GameObjectCommands.cs @@ -609,13 +609,13 @@ namespace Game.Chat if (string.IsNullOrEmpty(state)) return false; - if (!uint.TryParse(state, out uint objectState)) + if (!int.TryParse(state, out int objectState)) return false; if (objectType < 4) obj.SetByteValue(GameObjectFields.Bytes1, (byte)objectType, (byte)objectState); else if (objectType == 4) - obj.SendCustomAnim(objectState); + obj.SendCustomAnim((uint)objectState); else if (objectType == 5) { if (objectState < 0 || objectState > (uint)GameObjectDestructibleState.Rebuilding) diff --git a/Source/Game/Chat/Commands/ListCommands.cs b/Source/Game/Chat/Commands/ListCommands.cs index c9b63f003..48c7743a9 100644 --- a/Source/Game/Chat/Commands/ListCommands.cs +++ b/Source/Game/Chat/Commands/ListCommands.cs @@ -199,7 +199,7 @@ namespace Game.Chat.Commands uint ownerAccountId = result.Read(4); string ownerName = result.Read(5); - string itemPos = ""; + string itemPos; if (Player.IsEquipmentPos((byte)itemBag, itemSlot)) itemPos = "[equipped]"; else if (Player.IsInventoryPos((byte)itemBag, itemSlot)) diff --git a/Source/Game/Chat/Commands/ReloadCommand.cs b/Source/Game/Chat/Commands/ReloadCommand.cs index fdc825fee..24d9c40dc 100644 --- a/Source/Game/Chat/Commands/ReloadCommand.cs +++ b/Source/Game/Chat/Commands/ReloadCommand.cs @@ -618,7 +618,7 @@ namespace Game.Chat Global.ObjectMgr.LoadQuests(); handler.SendGlobalGMSysMessage("DB table `quest_template` (quest definitions) reloaded."); - /// dependent also from `gameobject` but this table not reloaded anyway + // dependent also from `gameobject` but this table not reloaded anyway Log.outInfo(LogFilter.Server, "Re-Loading GameObjects for quests..."); Global.ObjectMgr.LoadGameObjectForQuests(); handler.SendGlobalGMSysMessage("Data GameObjects for quests reloaded."); diff --git a/Source/Game/Chat/Commands/SendCommands.cs b/Source/Game/Chat/Commands/SendCommands.cs index 7528c421b..c6d6b3503 100644 --- a/Source/Game/Chat/Commands/SendCommands.cs +++ b/Source/Game/Chat/Commands/SendCommands.cs @@ -56,7 +56,7 @@ namespace Game.Chat.Commands // from console show not existed sender MailSender sender = new MailSender(MailMessageType.Normal, handler.GetSession() ? handler.GetSession().GetPlayer().GetGUID().GetCounter() : 0, MailStationery.Gm); - /// @todo Fix poor design + // @todo Fix poor design SQLTransaction trans = new SQLTransaction(); new MailDraft(subject, text) .SendMailTo(trans, new MailReceiver(target, targetGuid.GetCounter()), sender); @@ -102,7 +102,7 @@ namespace Game.Chat.Commands // get from tail next item str StringArguments itemStr; - while ((itemStr = new StringArguments(tail.NextString(" "))) != null) + while (!(itemStr = new StringArguments(tail.NextString(" "))).Empty()) { // parse item str string itemIdStr = itemStr.NextString(":"); @@ -172,7 +172,7 @@ namespace Game.Chat.Commands [Command("money", RBACPermissions.CommandSendMoney, true)] static bool HandleSendMoneyCommand(StringArguments args, CommandHandler handler) { - /// format: name "subject text" "mail text" money + // format: name "subject text" "mail text" money Player receiver; ObjectGuid receiverGuid; @@ -221,7 +221,7 @@ namespace Game.Chat.Commands [Command("message", RBACPermissions.CommandSendMessage, true)] static bool HandleSendMessageCommand(StringArguments args, CommandHandler handler) { - /// - Find the player + // - Find the player Player player; if (!handler.extractPlayerTarget(args, out player)) return false; @@ -237,7 +237,7 @@ namespace Game.Chat.Commands return false; } - /// - Send the message + // - Send the message player.GetSession().SendNotification("{0}", msgStr); player.GetSession().SendNotification("|cffff0000[Message from administrator]:|r"); diff --git a/Source/Game/Collision/Models/WorldModel.cs b/Source/Game/Collision/Models/WorldModel.cs index 0175ba27b..cc00f5445 100644 --- a/Source/Game/Collision/Models/WorldModel.cs +++ b/Source/Game/Collision/Models/WorldModel.cs @@ -240,7 +240,7 @@ namespace Game.Collision meshTree.readFromFile(reader); // write liquid data - if (reader.ReadStringFromChars(4).ToString() != "LIQU") + if (reader.ReadStringFromChars(4) != "LIQU") return false; chunkSize = reader.ReadUInt32(); diff --git a/Source/Game/Conditions/ConditionManager.cs b/Source/Game/Conditions/ConditionManager.cs index 9bbd7af2b..17d1c5d3e 100644 --- a/Source/Game/Conditions/ConditionManager.cs +++ b/Source/Game/Conditions/ConditionManager.cs @@ -1504,7 +1504,7 @@ namespace Game } case ConditionTypes.UnitState: { - if (cond.ConditionValue1 > (uint)UnitState.AllState) + if (cond.ConditionValue1 > (uint)UnitState.AllStateSupported) { Log.outError(LogFilter.Sql, "{0} has non existing UnitState in value1 ({1}), skipped.", cond.ToString(true), cond.ConditionValue1); return false; diff --git a/Source/Game/DungeonFinding/LFGManager.cs b/Source/Game/DungeonFinding/LFGManager.cs index 8d1cca257..2a1793aa5 100644 --- a/Source/Game/DungeonFinding/LFGManager.cs +++ b/Source/Game/DungeonFinding/LFGManager.cs @@ -2122,7 +2122,7 @@ namespace Game.DungeonFinding public bool isNew; public List queues = new List(); public List showorder = new List(); - public Dictionary players = new Dictionary(); ///< Players data + public Dictionary players = new Dictionary(); // Players data } public class LfgRoleCheck diff --git a/Source/Game/DungeonFinding/LFGScripts.cs b/Source/Game/DungeonFinding/LFGScripts.cs index c3429756e..bd7247f0f 100644 --- a/Source/Game/DungeonFinding/LFGScripts.cs +++ b/Source/Game/DungeonFinding/LFGScripts.cs @@ -60,7 +60,7 @@ namespace Game.DungeonFinding } Global.LFGMgr.SetTeam(player.GetGUID(), player.GetTeam()); - /// @todo - Restore LfgPlayerData and send proper status to player if it was in a group + // @todo - Restore LfgPlayerData and send proper status to player if it was in a group } public override void OnMapChanged(Player player) @@ -157,7 +157,7 @@ namespace Game.DungeonFinding if (isLFG && method == RemoveMethod.Kick) // Player have been kicked { - /// @todo - Update internal kick cooldown of kicker + // @todo - Update internal kick cooldown of kicker string str_reason = ""; if (!string.IsNullOrEmpty(reason)) str_reason = reason; diff --git a/Source/Game/Entities/AreaTrigger/AreaTrigger.cs b/Source/Game/Entities/AreaTrigger/AreaTrigger.cs index 919f367f7..cd6842b18 100644 --- a/Source/Game/Entities/AreaTrigger/AreaTrigger.cs +++ b/Source/Game/Entities/AreaTrigger/AreaTrigger.cs @@ -740,7 +740,7 @@ namespace Game.Entities public bool HasSplines() { return !_spline.empty(); } public Spline GetSpline() { return _spline; } - public uint GetElapsedTimeForMovement() { return GetTimeSinceCreated(); } /// @todo: research the right value, in sniffs both timers are nearly identical + public uint GetElapsedTimeForMovement() { return GetTimeSinceCreated(); } // @todo: research the right value, in sniffs both timers are nearly identical ObjectGuid _targetGuid; diff --git a/Source/Game/Entities/AreaTrigger/AreaTriggerTemplate.cs b/Source/Game/Entities/AreaTrigger/AreaTriggerTemplate.cs index 790e5ec93..dc7ef2787 100644 --- a/Source/Game/Entities/AreaTrigger/AreaTriggerTemplate.cs +++ b/Source/Game/Entities/AreaTrigger/AreaTriggerTemplate.cs @@ -121,41 +121,39 @@ namespace Game.Entities switch (TriggerType) { case AreaTriggerTypes.Sphere: - { - MaxSearchRadius = Math.Max(SphereDatas.Radius, SphereDatas.RadiusTarget); - break; - } + { + MaxSearchRadius = Math.Max(SphereDatas.Radius, SphereDatas.RadiusTarget); + break; + } case AreaTriggerTypes.Box: + { + fixed (float* ptr = BoxDatas.Extents) { - unsafe - { - fixed (float* ptr = BoxDatas.Extents) - { - MaxSearchRadius = (float)Math.Sqrt(ptr[0] * ptr[0] / 4 + ptr[1] * ptr[1] / 4); - } - } - break; + MaxSearchRadius = (float) Math.Sqrt(ptr[0] * ptr[0] / 4 + ptr[1] * ptr[1] / 4); } + + break; + } case AreaTriggerTypes.Polygon: + { + if (PolygonDatas.Height <= 0.0f) + PolygonDatas.Height = 1.0f; + + foreach (Vector2 vertice in PolygonVertices) { - if (PolygonDatas.Height <= 0.0f) - PolygonDatas.Height = 1.0f; + float pointDist = vertice.GetLength(); - foreach (Vector2 vertice in PolygonVertices) - { - float pointDist = vertice.GetLength(); - - if (pointDist > MaxSearchRadius) - MaxSearchRadius = pointDist; - } - - break; + if (pointDist > MaxSearchRadius) + MaxSearchRadius = pointDist; } + + break; + } case AreaTriggerTypes.Cylinder: - { - MaxSearchRadius = CylinderDatas.Radius; - break; - } + { + MaxSearchRadius = CylinderDatas.Radius; + break; + } default: break; } diff --git a/Source/Game/Entities/Conversation.cs b/Source/Game/Entities/Conversation.cs index 680e99675..bfa96748e 100644 --- a/Source/Game/Entities/Conversation.cs +++ b/Source/Game/Entities/Conversation.cs @@ -40,7 +40,7 @@ namespace Game.Entities public override void AddToWorld() { - ///- Register the Conversation for guid lookup and for caster + //- Register the Conversation for guid lookup and for caster if (!IsInWorld) { GetMap().GetObjectsStore().Add(GetGUID(), this); @@ -50,7 +50,7 @@ namespace Game.Entities public override void RemoveFromWorld() { - ///- Remove the Conversation from the accessor and from all lists of objects in world + //- Remove the Conversation from the accessor and from all lists of objects in world if (IsInWorld) { base.RemoveFromWorld(); @@ -110,7 +110,7 @@ namespace Game.Entities SetMap(map); Relocate(pos); - base._Create(ObjectGuid.Create(HighGuid.Conversation, GetMapId(), conversationEntry, lowGuid)); + _Create(ObjectGuid.Create(HighGuid.Conversation, GetMapId(), conversationEntry, lowGuid)); PhasingHandler.InheritPhaseShift(this, creator); SetEntry(conversationEntry); diff --git a/Source/Game/Entities/Creature/Creature.cs b/Source/Game/Entities/Creature/Creature.cs index aeda8985d..d29cbc2b5 100644 --- a/Source/Game/Entities/Creature/Creature.cs +++ b/Source/Game/Entities/Creature/Creature.cs @@ -1177,7 +1177,7 @@ namespace Game.Entities SetModifierValue(UnitMods.AttackPower, UnitModifierType.BaseValue, stats.AttackPower); SetModifierValue(UnitMods.AttackPowerRanged, UnitModifierType.BaseValue, stats.RangedAttackPower); - float armor = stats.GenerateArmor(cInfo); /// @todo Why is this treated as uint32 when it's a float? + float armor = stats.GenerateArmor(cInfo); // @todo Why is this treated as uint32 when it's a float? SetModifierValue(UnitMods.Armor, UnitModifierType.BaseValue, armor); } diff --git a/Source/Game/Entities/Creature/Gossip.cs b/Source/Game/Entities/Creature/Gossip.cs index b0b759c53..dd977cd3e 100644 --- a/Source/Game/Entities/Creature/Gossip.cs +++ b/Source/Game/Entities/Creature/Gossip.cs @@ -73,20 +73,20 @@ namespace Game.Misc /// action Custom action given to OnGossipHello. public void AddMenuItem(uint menuId, uint optionIndex, uint sender, uint action) { - /// Find items for given menu id. + // Find items for given menu id. var bounds = Global.ObjectMgr.GetGossipMenuItemsMapBounds(menuId); - /// Return if there are none. + // Return if there are none. if (bounds.Empty()) return; - /// Iterate over each of them. + // Iterate over each of them. foreach (var item in bounds) { // Find the one with the given menu item id. if (item.OptionIndex != optionIndex) continue; - /// Store texts for localization. + // Store texts for localization. string strOptionText = "", strBoxText = ""; BroadcastTextRecord optionBroadcastText = CliDB.BroadcastTextStorage.LookupByKey(item.OptionBroadcastTextId); BroadcastTextRecord boxBroadcastText = CliDB.BroadcastTextStorage.LookupByKey(item.BoxBroadcastTextId); diff --git a/Source/Game/Entities/GameObject/GameObject.cs b/Source/Game/Entities/GameObject/GameObject.cs index f3e07daea..a268bf096 100644 --- a/Source/Game/Entities/GameObject/GameObject.cs +++ b/Source/Game/Entities/GameObject/GameObject.cs @@ -396,16 +396,16 @@ namespace Game.Entities case GameObjectTypes.Trap: { // Arming Time for GAMEOBJECT_TYPE_TRAP (6) - GameObjectTemplate m_goInfo = GetGoInfo(); + GameObjectTemplate goInfo = GetGoInfo(); // Bombs Unit owner = GetOwner(); - if (m_goInfo.Trap.charges == 2) + if (goInfo.Trap.charges == 2) m_cooldownTime = (uint)Time.UnixTime + 10; // Hardcoded tooltip value else if (owner) { if (owner.IsInCombat()) - m_cooldownTime = (uint)Time.UnixTime + m_goInfo.Trap.startDelay; + m_cooldownTime = (uint)Time.UnixTime + goInfo.Trap.startDelay; } m_lootState = LootState.Ready; break; @@ -1552,7 +1552,7 @@ namespace Game.Entities player.UpdateFishingSkill(); - /// @todo find reasonable value for fishing hole search + // @todo find reasonable value for fishing hole search GameObject fishingPool = LookupFishingHoleAround(20.0f + SharedConst.ContactDistance); // If fishing skill is high enough, or if fishing on a pool, send correct loot. diff --git a/Source/Game/Entities/Player/Player.Spells.cs b/Source/Game/Entities/Player/Player.Spells.cs index e0eb60e9f..9e377028b 100644 --- a/Source/Game/Entities/Player/Player.Spells.cs +++ b/Source/Game/Entities/Player/Player.Spells.cs @@ -2563,13 +2563,13 @@ namespace Game.Entities { Log.outDebug(LogFilter.Spells, "Player.AddSpellMod {0}", mod.spellId); - /// First, manipulate our spellmodifier container + // First, manipulate our spellmodifier container if (apply) m_spellMods[(int)mod.op][(int)mod.type].Add(mod); else m_spellMods[(int)mod.op][(int)mod.type].Remove(mod); - /// Now, send spellmodifier packet + // Now, send spellmodifier packet if (!IsLoading()) { ServerOpcodes opcode = (mod.type == SpellModType.Flat ? ServerOpcodes.SetFlatSpellModifier : ServerOpcodes.SetPctSpellModifier); diff --git a/Source/Game/Entities/Player/Player.cs b/Source/Game/Entities/Player/Player.cs index dc259dd5d..db4b44c0c 100644 --- a/Source/Game/Entities/Player/Player.cs +++ b/Source/Game/Entities/Player/Player.cs @@ -1952,7 +1952,7 @@ namespace Game.Entities //move player's guid into HateOfflineList of those mobs //which can't swim and move guid back into ThreatList when //on surface. - /// @todo exist also swimming mobs, and function must be symmetric to enter/leave water + // @todo exist also swimming mobs, and function must be symmetric to enter/leave water m_isInWater = apply; // remove auras that need water/land @@ -5283,7 +5283,7 @@ namespace Game.Entities packet.Level = level; packet.HealthDelta = 0; - /// @todo find some better solution + // @todo find some better solution packet.PowerDelta[0] = (int)basemana - (int)GetCreateMana(); packet.PowerDelta[1] = 0; packet.PowerDelta[2] = 0; @@ -5584,18 +5584,18 @@ namespace Game.Entities loginSetTimeSpeed.NewSpeed = TimeSpeed; loginSetTimeSpeed.GameTime = (uint)Global.WorldMgr.GetGameTime(); loginSetTimeSpeed.ServerTime = (uint)Global.WorldMgr.GetGameTime(); - loginSetTimeSpeed.GameTimeHolidayOffset = 0; /// @todo - loginSetTimeSpeed.ServerTimeHolidayOffset = 0; /// @todo + loginSetTimeSpeed.GameTimeHolidayOffset = 0; // @todo + loginSetTimeSpeed.ServerTimeHolidayOffset = 0; // @todo SendPacket(loginSetTimeSpeed); // SMSG_WORLD_SERVER_INFO WorldServerInfo worldServerInfo = new WorldServerInfo(); - worldServerInfo.InstanceGroupSize.Set(GetMap().GetMapDifficulty().MaxPlayers); /// @todo - worldServerInfo.IsTournamentRealm = 0; /// @todo - worldServerInfo.RestrictedAccountMaxLevel.Clear(); /// @todo - worldServerInfo.RestrictedAccountMaxMoney.Clear(); /// @todo + worldServerInfo.InstanceGroupSize.Set(GetMap().GetMapDifficulty().MaxPlayers); // @todo + worldServerInfo.IsTournamentRealm = 0; // @todo + worldServerInfo.RestrictedAccountMaxLevel.Clear(); // @todo + worldServerInfo.RestrictedAccountMaxMoney.Clear(); // @todo worldServerInfo.DifficultyID = (uint)GetMap().GetDifficultyID(); - // worldServerInfo.XRealmPvpAlert; /// @todo + // worldServerInfo.XRealmPvpAlert; // @todo SendPacket(worldServerInfo); // Spell modifiers diff --git a/Source/Game/Entities/TemporarySummon.cs b/Source/Game/Entities/TemporarySummon.cs index 6c69c893a..90e6ec23d 100644 --- a/Source/Game/Entities/TemporarySummon.cs +++ b/Source/Game/Entities/TemporarySummon.cs @@ -232,7 +232,7 @@ namespace Game.Entities public override void UpdateObjectVisibilityOnCreate() { - base.UpdateObjectVisibility(true); + UpdateObjectVisibility(true); } public void SetTempSummonType(TempSummonType type) diff --git a/Source/Game/Entities/Unit/Unit.Combat.cs b/Source/Game/Entities/Unit/Unit.Combat.cs index c1dc5180d..7c316f072 100644 --- a/Source/Game/Entities/Unit/Unit.Combat.cs +++ b/Source/Game/Entities/Unit/Unit.Combat.cs @@ -2411,7 +2411,7 @@ namespace Game.Entities bool defaultPrevented = false; - absorbAurEff.GetBase().CallScriptEffectManaShieldHandlers(absorbAurEff, aurApp, damageInfo, ref tempAbsorb, defaultPrevented); + absorbAurEff.GetBase().CallScriptEffectManaShieldHandlers(absorbAurEff, aurApp, damageInfo, ref tempAbsorb, ref defaultPrevented); currentAbsorb = (int)tempAbsorb; if (defaultPrevented) diff --git a/Source/Game/Entities/Unit/Unit.Fields.cs b/Source/Game/Entities/Unit/Unit.Fields.cs index ce1daf569..6b74c6d91 100644 --- a/Source/Game/Entities/Unit/Unit.Fields.cs +++ b/Source/Game/Entities/Unit/Unit.Fields.cs @@ -476,11 +476,11 @@ namespace Game.Entities hitOutCome = _hitOutCome; } - public uint absorbed_damage { get; set; } + public uint absorbed_damage { get; } public uint mitigated_damage { get; set; } - public WeaponAttackType attackType { get; set; } - public MeleeHitOutcome hitOutCome { get; set; } + public WeaponAttackType attackType { get; } + public MeleeHitOutcome hitOutCome { get; } } public class DispelInfo diff --git a/Source/Game/Entities/Unit/Unit.Spells.cs b/Source/Game/Entities/Unit/Unit.Spells.cs index 5cbc08ca2..36827d71c 100644 --- a/Source/Game/Entities/Unit/Unit.Spells.cs +++ b/Source/Game/Entities/Unit/Unit.Spells.cs @@ -2243,7 +2243,7 @@ namespace Game.Entities spellHealLog.Crit = critical; - /// @todo: 6.x Has to be implemented + // @todo: 6.x Has to be implemented /* var hasCritRollMade = spellHealLog.WriteBit("HasCritRollMade"); var hasCritRollNeeded = spellHealLog.WriteBit("HasCritRollNeeded"); @@ -2494,7 +2494,7 @@ namespace Game.Entities spellLogEffect.AbsorbedOrAmplitude = info.absorb; spellLogEffect.Resisted = info.resist; spellLogEffect.Crit = info.critical; - /// @todo: implement debug info + // @todo: implement debug info SandboxScalingData sandboxScalingData = new SandboxScalingData(); Unit caster = Global.ObjAccessor.GetUnit(this, aura.GetCasterGUID()); @@ -4181,10 +4181,9 @@ namespace Game.Entities } bool remove = false; - var appliedAuraList = GetAppliedAuras(); - for (var i = 0; i < appliedAuraList.Count; i++) + for (var i = 0; i < m_appliedAuras.KeyValueList.Count; i++) { - var app = appliedAuraList[i]; + var app = m_appliedAuras.KeyValueList[i]; if (remove) { remove = false; @@ -4195,7 +4194,7 @@ namespace Game.Entities continue; RemoveAura(app, AuraRemoveMode.Default); - if (i == appliedAuraList.Count - 1) + if (i == m_appliedAuras.KeyValueList.Count - 1) break; remove = true; diff --git a/Source/Game/Entities/Vehicle.cs b/Source/Game/Entities/Vehicle.cs index 9d4074b59..f86f6f872 100644 --- a/Source/Game/Entities/Vehicle.cs +++ b/Source/Game/Entities/Vehicle.cs @@ -227,7 +227,7 @@ namespace Game.Entities { var seat = Seats.LookupByKey(seatId); if (seat == null) - return seat; + return null; foreach (var sea in Seats) { @@ -633,7 +633,7 @@ namespace Game.Entities Log.outDebug(LogFilter.Vehicle, "Passenger GuidLow: {0}, Entry: {1}, board on vehicle GuidLow: {2}, Entry: {3} SeatId: {4} cancelled", Passenger.GetGUID().ToString(), Passenger.GetEntry(), Target.GetBase().GetGUID().ToString(), Target.GetBase().GetEntry(), Seat.Key); - /// Remove the pending event when Abort was called on the event directly + // Remove the pending event when Abort was called on the event directly Target.RemovePendingEvent(this); // @SPELL_AURA_CONTROL_VEHICLE auras can be applied even when the passenger is not (yet) on the vehicle. diff --git a/Source/Game/Events/GameEventManager.cs b/Source/Game/Events/GameEventManager.cs index 24eb5d48e..180771c1b 100644 --- a/Source/Game/Events/GameEventManager.cs +++ b/Source/Game/Events/GameEventManager.cs @@ -726,7 +726,7 @@ namespace Game do { uint questId = result.Read(0); - ushort eventEntry = result.Read(1); /// @todo Change to byte + ushort eventEntry = result.Read(1); // @todo Change to byte if (Global.ObjectMgr.GetQuestTemplate(questId) == null) { @@ -1214,10 +1214,10 @@ namespace Game if (!map.Instanceable() && map.IsGridLoaded(data.posX, data.posY)) { GameObject pGameobject = GameObject.CreateGameObjectFromDB(guid, map, false); - /// @todo find out when it is add to map + // @todo find out when it is add to map if (pGameobject) { - /// @todo find out when it is add to map + // @todo find out when it is add to map if (pGameobject.isSpawnedByDefault()) map.AddToMap(pGameobject); } diff --git a/Source/Game/Globals/ObjectManager.cs b/Source/Game/Globals/ObjectManager.cs index 51a4bb34a..c27b11a5e 100644 --- a/Source/Game/Globals/ObjectManager.cs +++ b/Source/Game/Globals/ObjectManager.cs @@ -4561,6 +4561,7 @@ namespace Game ItemTemplateStorage.Add(sparse.Id, itemTemplate); } + // Load item effects (spells) foreach (var effectEntry in CliDB.ItemEffectStorage.Values) { var itemTemplate = ItemTemplateStorage.LookupByKey(effectEntry.ParentItemID); diff --git a/Source/Game/Guilds/Guild.cs b/Source/Game/Guilds/Guild.cs index 5707e6a75..a2620391b 100644 --- a/Source/Game/Guilds/Guild.cs +++ b/Source/Game/Guilds/Guild.cs @@ -939,7 +939,7 @@ namespace Game.Guilds GuildChallengeUpdate updatePacket = new GuildChallengeUpdate(); for (int i = 0; i < GuildConst.ChallengesTypes; ++i) - updatePacket.CurrentCount[i] = 0; /// @todo current count + updatePacket.CurrentCount[i] = 0; // @todo current count for (int i = 0; i < GuildConst.ChallengesTypes; ++i) updatePacket.MaxCount[i] = GuildConst.ChallengesMaxCount[i]; @@ -3697,7 +3697,7 @@ namespace Game.Guilds public override void LogAction(MoveItemData pFrom) { base.LogAction(pFrom); - if (!pFrom.IsBank() && m_pPlayer.GetSession().HasPermission(RBACPermissions.LogGmTrade)) /// @todo Move this to scripts + if (!pFrom.IsBank() && m_pPlayer.GetSession().HasPermission(RBACPermissions.LogGmTrade)) // @todo Move this to scripts { Log.outCommand(m_pPlayer.GetSession().GetAccountId(), "GM {0} ({1}) (Account: {2}) deposit item: {3} (Entry: {4} Count: {5}) to guild bank named: {6} (Guild ID: {7})", m_pPlayer.GetName(), m_pPlayer.GetGUID().ToString(), m_pPlayer.GetSession().GetAccountId(), pFrom.GetItem().GetTemplate().GetName(), diff --git a/Source/Game/Handlers/AuctionHandler.cs b/Source/Game/Handlers/AuctionHandler.cs index 3d23872a5..2b94d0f0b 100644 --- a/Source/Game/Handlers/AuctionHandler.cs +++ b/Source/Game/Handlers/AuctionHandler.cs @@ -231,7 +231,7 @@ namespace Game SQLTransaction trans; if (WorldConfig.GetBoolValue(WorldCfg.AllowTwoSideInteractionAuction)) - AH.auctioneer = 23442; ///@TODO - HARDCODED DB GUID, BAD BAD BAD + AH.auctioneer = 23442; //@TODO - HARDCODED DB GUID, BAD BAD BAD else AH.auctioneer = creature.GetSpawnId(); diff --git a/Source/Game/Handlers/AuthenticationHandler.cs b/Source/Game/Handlers/AuthenticationHandler.cs index 55f88e7db..d2e159d17 100644 --- a/Source/Game/Handlers/AuthenticationHandler.cs +++ b/Source/Game/Handlers/AuthenticationHandler.cs @@ -81,7 +81,7 @@ namespace Game public void SendSetTimeZoneInformation() { - /// @todo: replace dummy values + // @todo: replace dummy values SetTimeZoneInformation packet = new SetTimeZoneInformation(); packet.ServerTimeTZ = "Europe/Paris"; packet.GameTimeTZ = "Europe/Paris"; diff --git a/Source/Game/Handlers/BattleGroundHandler.cs b/Source/Game/Handlers/BattleGroundHandler.cs index 297281aa3..2a6e8d241 100644 --- a/Source/Game/Handlers/BattleGroundHandler.cs +++ b/Source/Game/Handlers/BattleGroundHandler.cs @@ -591,8 +591,8 @@ namespace Game [WorldPacketHandler(ClientOpcodes.RequestRatedBattlefieldInfo)] void HandleRequestRatedBattlefieldInfo(RequestRatedBattlefieldInfo packet) { - /// @Todo: perfome research in this case - /// The unk fields are related to arenas + // @Todo: perfome research in this case + // The unk fields are related to arenas WorldPacket data = new WorldPacket(ServerOpcodes.RatedBattlefieldInfo); data.WriteInt32(0); // BgWeeklyWins20vs20 data.WriteInt32(0); // BgWeeklyPlayed20vs20 diff --git a/Source/Game/Handlers/CalendarHandler.cs b/Source/Game/Handlers/CalendarHandler.cs index 5a8cc9821..bbc50ab5c 100644 --- a/Source/Game/Handlers/CalendarHandler.cs +++ b/Source/Game/Handlers/CalendarHandler.cs @@ -208,7 +208,7 @@ namespace Game return; CalendarEvent oldEvent = Global.CalendarMgr.GetEvent(calendarCopyEvent.EventID); - if (oldEvent == null) + if (oldEvent != null) { CalendarEvent newEvent = new CalendarEvent(oldEvent, Global.CalendarMgr.GetFreeEventId()); newEvent.Date = calendarCopyEvent.Date; diff --git a/Source/Game/Handlers/CharacterHandler.cs b/Source/Game/Handlers/CharacterHandler.cs index 4059c61a1..90e6ca674 100644 --- a/Source/Game/Handlers/CharacterHandler.cs +++ b/Source/Game/Handlers/CharacterHandler.cs @@ -132,7 +132,7 @@ namespace Game [WorldPacketHandler(ClientOpcodes.EnumCharactersDeletedByClient, Status = SessionStatus.Authed)] void HandleCharUndeleteEnum(EnumCharacters enumCharacters) { - /// get all the data necessary for loading all undeleted characters (along with their pets) on the account + // get all the data necessary for loading all undeleted characters (along with their pets) on the account PreparedStatement stmt; if (WorldConfig.GetBoolValue(WorldCfg.DeclinedNamesUsed)) stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_UNDELETE_ENUM_DECLINED_NAME); @@ -379,7 +379,7 @@ namespace Game } // need to check team only for first character - /// @todo what to if account already has characters of both races? + // @todo what to if account already has characters of both races? if (!allowTwoSideAccounts) { Team accTeam = 0; @@ -866,7 +866,7 @@ namespace Game { FeatureSystemStatus features = new FeatureSystemStatus(); - /// START OF DUMMY VALUES + // START OF DUMMY VALUES features.ComplaintStatus = 2; features.ScrollOfResurrectionRequestsRemaining = 1; features.ScrollOfResurrectionMaxRequestsPerDay = 1; @@ -887,7 +887,7 @@ namespace Game features.ComplaintStatus = 0; features.TutorialsEnabled = true; features.NPETutorialsEnabled = true; - /// END OF DUMMY VALUES + // END OF DUMMY VALUES features.EuropaTicketSystemStatus.Value.TicketsEnabled = WorldConfig.GetBoolValue(WorldCfg.SupportTicketsEnabled); features.EuropaTicketSystemStatus.Value.BugsEnabled = WorldConfig.GetBoolValue(WorldCfg.SupportBugsEnabled); @@ -1246,7 +1246,7 @@ namespace Game } // character with this name already exist - /// @todo: make async + // @todo: make async ObjectGuid newGuid = ObjectManager.GetPlayerGUIDByName(customizeInfo.CharName); if (!newGuid.IsEmpty()) { @@ -1261,7 +1261,7 @@ namespace Game SQLTransaction trans = new SQLTransaction(); ulong lowGuid = customizeInfo.CharGUID.GetCounter(); - /// Customize + // Customize { stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_GENDER_AND_APPEARANCE); @@ -1279,7 +1279,7 @@ namespace Game trans.Append(stmt); } - /// Name Change and update atLogin flags + // Name Change and update atLogin flags { stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_CHAR_NAME_AT_LOGIN); stmt.AddValue(0, customizeInfo.CharName); @@ -1325,11 +1325,11 @@ namespace Game { Item item = _player.GetItemByPos(InventorySlots.Bag0, i); - /// cheating check 1 (item equipped but sent empty guid) + // cheating check 1 (item equipped but sent empty guid) if (!item) return; - /// cheating check 2 (sent guid does not match equipped item) + // cheating check 2 (sent guid does not match equipped item) if (item.GetGUID() != itemGuid) return; } @@ -1358,7 +1358,7 @@ namespace Game saveEquipmentSet.Set.Appearances[i] = 0; } } - saveEquipmentSet.Set.IgnoreMask &= 0x7FFFF; /// clear invalid bits (i > EQUIPMENT_SLOT_END) + saveEquipmentSet.Set.IgnoreMask &= 0x7FFFF; // clear invalid bits (i > EQUIPMENT_SLOT_END) if (saveEquipmentSet.Set.Type == EquipmentSetInfo.EquipmentSetType.Equipment) { saveEquipmentSet.Set.Enchants[0] = 0; @@ -1583,7 +1583,7 @@ namespace Game // resurrect the character in case he's dead Player.OfflineResurrect(factionChangeInfo.Guid, trans); - /// Name Change and update atLogin flags + // Name Change and update atLogin flags { stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_CHAR_NAME_AT_LOGIN); stmt.AddValue(0, factionChangeInfo.Name); @@ -1719,7 +1719,7 @@ namespace Game trans.Append(stmt); } - /// @todo: make this part asynch + // @todo: make this part asynch if (!WorldConfig.GetBoolValue(WorldCfg.AllowTwoSideInteractionGuild)) { // Reset guild @@ -2092,11 +2092,11 @@ namespace Game return; } - /// @todo: add more safety checks - /// * max char count per account - /// * max death knight count - /// * max demon hunter count - /// * team violation + // @todo: add more safety checks + // * max char count per account + // * max death knight count + // * max demon hunter count + // * team violation stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_SUM_CHARS); stmt.AddValue(0, GetAccountId()); diff --git a/Source/Game/Handlers/ChatHandler.cs b/Source/Game/Handlers/ChatHandler.cs index cecd7b730..0ee4df83a 100644 --- a/Source/Game/Handlers/ChatHandler.cs +++ b/Source/Game/Handlers/ChatHandler.cs @@ -448,7 +448,7 @@ namespace Game } break; case ChatMsg.Whisper: - /// @todo implement cross realm whispers (someday) + // @todo implement cross realm whispers (someday) ExtendedPlayerName extName = ObjectManager.ExtractExtendedPlayerName(target); if (!ObjectManager.NormalizePlayerName(ref extName.Name)) diff --git a/Source/Game/Handlers/InspectHandler.cs b/Source/Game/Handlers/InspectHandler.cs index 783ce094a..2dad8e8a6 100644 --- a/Source/Game/Handlers/InspectHandler.cs +++ b/Source/Game/Handlers/InspectHandler.cs @@ -102,7 +102,7 @@ namespace Game honorStats.LifetimeHK = player.GetUInt32Value(PlayerFields.LifetimeHonorableKills); honorStats.YesterdayHK = player.GetUInt16Value(PlayerFields.Kills, 1); honorStats.TodayHK = player.GetUInt16Value(PlayerFields.Kills, 0); - honorStats.LifetimeMaxRank = 0; /// @todo + honorStats.LifetimeMaxRank = 0; // @todo SendPacket(honorStats); } @@ -110,7 +110,7 @@ namespace Game [WorldPacketHandler(ClientOpcodes.InspectPvp)] void HandleInspectPVP(InspectPVPRequest request) { - /// @todo: deal with request.InspectRealmAddress + // @todo: deal with request.InspectRealmAddress Player player = Global.ObjAccessor.FindPlayer(request.InspectTarget); if (!player) @@ -127,7 +127,7 @@ namespace Game InspectPVPResponse response = new InspectPVPResponse(); response.ClientGUID = request.InspectTarget; - /// @todo: fill brackets + // @todo: fill brackets SendPacket(response); } diff --git a/Source/Game/Handlers/ItemHandler.cs b/Source/Game/Handlers/ItemHandler.cs index e97cfa878..75021ddb0 100644 --- a/Source/Game/Handlers/ItemHandler.cs +++ b/Source/Game/Handlers/ItemHandler.cs @@ -359,7 +359,7 @@ namespace Game } else { - /// @todo: 6.x research new values + // @todo: 6.x research new values /*WorldPackets.Item.ReadItemResultFailed packet; packet.Item = item->GetGUID(); packet.Subcode = ??; diff --git a/Source/Game/Handlers/LootHandler.cs b/Source/Game/Handlers/LootHandler.cs index f334c072d..142ee33c4 100644 --- a/Source/Game/Handlers/LootHandler.cs +++ b/Source/Game/Handlers/LootHandler.cs @@ -37,7 +37,7 @@ namespace Game Player player = GetPlayer(); AELootResult aeResult = player.GetAELootView().Count > 1 ? new AELootResult() : null; - /// @todo Implement looting by LootObject guid + // @todo Implement looting by LootObject guid foreach (LootRequest req in packet.Loot) { Loot loot = null; diff --git a/Source/Game/Handlers/MovementHandler.cs b/Source/Game/Handlers/MovementHandler.cs index 9cb0bfc92..da0cb1acd 100644 --- a/Source/Game/Handlers/MovementHandler.cs +++ b/Source/Game/Handlers/MovementHandler.cs @@ -186,7 +186,7 @@ namespace Game { // NOTE: this is actually called many times while falling // even after the player has been teleported away - /// @todo discard movement packets after the player is rooted + // @todo discard movement packets after the player is rooted if (plrMover.IsAlive()) { plrMover.SetFlag(PlayerFields.Flags, PlayerFlags.IsOutOfBounds); diff --git a/Source/Game/Handlers/PetHandler.cs b/Source/Game/Handlers/PetHandler.cs index 2f88538da..a6149bfec 100644 --- a/Source/Game/Handlers/PetHandler.cs +++ b/Source/Game/Handlers/PetHandler.cs @@ -83,7 +83,7 @@ namespace Game return; } - /// @todo allow control charmed player? + // @todo allow control charmed player? if (pet.IsTypeId(TypeId.Player) && !(flag == ActiveStates.Command && spellid == (uint)CommandStates.Attack)) return; @@ -169,7 +169,7 @@ namespace Game // Can't attack if owner is pacified if (GetPlayer().HasAuraType(AuraType.ModPacify)) { - /// @todo Send proper error message to client + // @todo Send proper error message to client return; } @@ -376,7 +376,7 @@ namespace Game } else { - if (pet.isPossessed() || pet.IsVehicle()) /// @todo: confirm this check + if (pet.isPossessed() || pet.IsVehicle()) // @todo: confirm this check Spell.SendCastResult(GetPlayer(), spellInfo, spell.m_SpellVisual, spell.m_castId, result); else spell.SendPetCastResult(result); diff --git a/Source/Game/Handlers/QuestHandler.cs b/Source/Game/Handlers/QuestHandler.cs index c1898ea62..595c85c57 100644 --- a/Source/Game/Handlers/QuestHandler.cs +++ b/Source/Game/Handlers/QuestHandler.cs @@ -471,7 +471,7 @@ namespace Game if (!GetPlayer().IsInSameRaidWith(originalPlayer)) return; - if (!!originalPlayer.IsActiveQuest(packet.QuestID)) + if (!originalPlayer.IsActiveQuest(packet.QuestID)) return; if (!GetPlayer().CanTakeQuest(quest, true)) @@ -646,7 +646,7 @@ namespace Game { WorldQuestUpdate response = new WorldQuestUpdate(); - /// @todo: 7.x Has to be implemented + // @todo: 7.x Has to be implemented //response.WorldQuestUpdates.push_back(WorldPackets::Quest::WorldQuestUpdateInfo(lastUpdate, questID, timer, variableID, value)); SendPacket(response); diff --git a/Source/Game/Handlers/SocialHandler.cs b/Source/Game/Handlers/SocialHandler.cs index 329153208..547a44e9a 100644 --- a/Source/Game/Handlers/SocialHandler.cs +++ b/Source/Game/Handlers/SocialHandler.cs @@ -44,17 +44,17 @@ namespace Game if (request.Words.Count > 4) return; - /// @todo: handle following packet values - /// VirtualRealmNames - /// ShowEnemies - /// ShowArenaPlayers - /// ExactName - /// ServerInfo + // @todo: handle following packet values + // VirtualRealmNames + // ShowEnemies + // ShowArenaPlayers + // ExactName + // ServerInfo request.Words.ForEach(p => p = p.ToLower()); - request.Name.ToLower(); - request.Guild.ToLower(); + request.Name = request.Name.ToLower(); + request.Guild = request.Guild.ToLower(); // client send in case not set max level value 100 but we support 255 max level, // update it to show GMs with characters after 100 level @@ -282,7 +282,7 @@ namespace Game [WorldPacketHandler(ClientOpcodes.DelFriend)] void HandleDelFriend(DelFriend packet) { - /// @todo: handle VirtualRealmAddress + // @todo: handle VirtualRealmAddress GetPlayer().GetSocial().RemoveFromSocialList(packet.Player.Guid, SocialFlag.Friend); Global.SocialMgr.SendFriendStatus(GetPlayer(), FriendsResult.Removed, packet.Player.Guid); @@ -336,7 +336,7 @@ namespace Game [WorldPacketHandler(ClientOpcodes.DelIgnore)] void HandleDelIgnore(DelIgnore packet) { - /// @todo: handle VirtualRealmAddress + // @todo: handle VirtualRealmAddress Log.outDebug(LogFilter.Network, "WorldSession.HandleDelIgnoreOpcode: {0}", packet.Player.Guid.ToString()); GetPlayer().GetSocial().RemoveFromSocialList(packet.Player.Guid, SocialFlag.Ignored); @@ -347,7 +347,7 @@ namespace Game [WorldPacketHandler(ClientOpcodes.SetContactNotes)] void HandleSetContactNotes(SetContactNotes packet) { - /// @todo: handle VirtualRealmAddress + // @todo: handle VirtualRealmAddress Log.outDebug(LogFilter.Network, "WorldSession.HandleSetContactNotesOpcode: Contact: {0}, Notes: {1}", packet.Player.Guid.ToString(), packet.Notes); GetPlayer().GetSocial().SetFriendNote(packet.Player.Guid, packet.Notes); } diff --git a/Source/Game/Handlers/SpellHandler.cs b/Source/Game/Handlers/SpellHandler.cs index fd7660627..0274c4fe2 100644 --- a/Source/Game/Handlers/SpellHandler.cs +++ b/Source/Game/Handlers/SpellHandler.cs @@ -469,7 +469,7 @@ namespace Game if (unit == null) return; - /// @todo Unit.SetCharmedBy: 28782 is not in world but 0 is trying to charm it! . crash + // @todo Unit.SetCharmedBy: 28782 is not in world but 0 is trying to charm it! . crash if (!unit.IsInWorld) return; diff --git a/Source/Game/Handlers/TokenHandler.cs b/Source/Game/Handlers/TokenHandler.cs index 1c422fec7..368f443fb 100644 --- a/Source/Game/Handlers/TokenHandler.cs +++ b/Source/Game/Handlers/TokenHandler.cs @@ -28,7 +28,7 @@ namespace Game { UpdateListedAuctionableTokensResponse response = new UpdateListedAuctionableTokensResponse(); - /// @todo: fix 6.x implementation + // @todo: fix 6.x implementation response.UnkInt = updateListedAuctionableTokens.UnkInt; response.Result = TokenResult.Success; @@ -40,7 +40,7 @@ namespace Game { WowTokenMarketPriceResponse response = new WowTokenMarketPriceResponse(); - /// @todo: 6.x fix implementation + // @todo: 6.x fix implementation response.CurrentMarketPrice = 300000000; response.UnkInt = requestWowTokenMarketPrice.UnkInt; response.Result = TokenResult.Success; diff --git a/Source/Game/Loot/LootManager.cs b/Source/Game/Loot/LootManager.cs index d147c1903..d7a40dd82 100644 --- a/Source/Game/Loot/LootManager.cs +++ b/Source/Game/Loot/LootManager.cs @@ -841,7 +841,7 @@ namespace Game.Loots foreach (var group in Groups) group.Value.Verify(lootstore, id, (byte)(group.Key + 1)); - /// @todo References validity checks + // @todo References validity checks } public void CheckLootRefs(LootTemplateMap store, List ref_set) { @@ -992,7 +992,7 @@ namespace Game.Loots public void Verify(LootStore lootstore, uint id, byte group_id = 0) { float chance = RawTotalChance(); - if (chance > 101.0f) /// @todo replace with 100% when DBs will be ready + if (chance > 101.0f) // @todo replace with 100% when DBs will be ready Log.outError(LogFilter.Sql, "Table '{0}' entry {1} group {2} has total chance > 100% ({3})", lootstore.GetName(), id, group_id, chance); if (chance >= 100.0f && !EqualChanced.Empty()) diff --git a/Source/Game/Maps/Map.cs b/Source/Game/Maps/Map.cs index dfece569d..eb196a5dc 100644 --- a/Source/Game/Maps/Map.cs +++ b/Source/Game/Maps/Map.cs @@ -338,7 +338,7 @@ namespace Game.Maps void DeleteFromWorld(Player player) { Global.ObjAccessor.RemoveObject(player); - RemoveUpdateObject(player); /// @todo I do not know why we need this, it should be removed in ~Object anyway + RemoveUpdateObject(player); // @todo I do not know why we need this, it should be removed in ~Object anyway player.Dispose(); } @@ -1147,8 +1147,8 @@ namespace Game.Maps //This may happen when a player just logs in and a pet moves to a nearby unloaded cell //To avoid this, we can load nearby cells when player log in //But this check is always needed to ensure safety - /// @todo pets will disappear if this is outside CreatureRespawnRelocation - /// //need to check why pet is frequently relocated to an unloaded cell + // @todo pets will disappear if this is outside CreatureRespawnRelocation + //need to check why pet is frequently relocated to an unloaded cell if (creature.IsPet()) ((Pet)creature).Remove(PetSaveMode.NotInSlot, true); else @@ -4434,7 +4434,7 @@ namespace Game.Maps public override bool AddPlayerToMap(Player player, bool initPlayer = true) { - /// @todo Not sure about checking player level: already done in HandleAreaTriggerOpcode + // @todo Not sure about checking player level: already done in HandleAreaTriggerOpcode // GMs still can teleport player in instance. // Is it needed? lock(_mapLock) @@ -4623,7 +4623,7 @@ namespace Game.Maps if (load) { - /// @todo make a global storage for this + // @todo make a global storage for this PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_INSTANCE); stmt.AddValue(0, GetId()); stmt.AddValue(1, i_InstanceId); diff --git a/Source/Game/Movement/Generators/PathGenerator.cs b/Source/Game/Movement/Generators/PathGenerator.cs index 2947d2c19..87ace3bf1 100644 --- a/Source/Game/Movement/Generators/PathGenerator.cs +++ b/Source/Game/Movement/Generators/PathGenerator.cs @@ -255,7 +255,7 @@ namespace Game.Movement } // look for startPoly/endPoly in current path - /// @todo we can merge it with getPathPolyByPosition() loop + // @todo we can merge it with getPathPolyByPosition() loop bool startPolyFound = false; bool endPolyFound = false; uint pathStartIndex = 0; @@ -314,7 +314,7 @@ namespace Game.Movement // sub-path of optimal path is optimal // take ~80% of the original length - /// @todo play with the values here + // @todo play with the values here uint prefixPolyLength = (uint)(_polyLength * 0.8f + 0.5f); Array.Copy(_pathPolyRefs, pathStartIndex, _pathPolyRefs, 0, prefixPolyLength); @@ -523,7 +523,7 @@ namespace Game.Movement { // only happens if pass bad data to findStraightPath or navmesh is broken // single point paths can be generated here - /// @todo check the exact cases + // @todo check the exact cases Log.outDebug(LogFilter.Maps, "++ PathGenerator.BuildPointPath FAILED! path sized {0} returned\n", pointCount); BuildShortcut(); pathType = PathType.NoPath; @@ -921,9 +921,9 @@ namespace Game.Movement _navMesh.calcTileLoc(point, ref tx, ref ty); - /// Workaround - /// For some reason, often the tx and ty variables wont get a valid value - /// Use this check to prevent getting negative tile coords and crashing on getTileAt + // Workaround + // For some reason, often the tx and ty variables wont get a valid value + // Use this check to prevent getting negative tile coords and crashing on getTileAt if (tx < 0 || ty < 0) return false; diff --git a/Source/Game/Movement/MoveSplineInitArgs.cs b/Source/Game/Movement/MoveSplineInitArgs.cs index e348e68f9..e9658e160 100644 --- a/Source/Game/Movement/MoveSplineInitArgs.cs +++ b/Source/Game/Movement/MoveSplineInitArgs.cs @@ -54,7 +54,7 @@ namespace Game.Movement // Returns true to show that the arguments were configured correctly and MoveSpline initialization will succeed. public bool Validate(Unit unit) { - Func CHECK = new Func(exp => + Func CHECK = exp => { if (!(exp)) { @@ -62,7 +62,7 @@ namespace Game.Movement return false; } return true; - }); + }; if (!CHECK(path.Length > 1)) return false; diff --git a/Source/Game/Network/Packets/AuthenticationPackets.cs b/Source/Game/Network/Packets/AuthenticationPackets.cs index f50e3bd66..5af38192a 100644 --- a/Source/Game/Network/Packets/AuthenticationPackets.cs +++ b/Source/Game/Network/Packets/AuthenticationPackets.cs @@ -139,8 +139,8 @@ namespace Game.Network.Packets foreach (var klass in SuccessInfo.Value.AvailableClasses) { - _worldPacket.WriteUInt8(klass.Key); /// the current class - _worldPacket.WriteUInt8(klass.Value); /// the required Expansion + _worldPacket.WriteUInt8(klass.Key); // the current class + _worldPacket.WriteUInt8(klass.Value); // the required Expansion } _worldPacket.WriteBit(SuccessInfo.Value.IsExpansionTrial); diff --git a/Source/Game/Network/Packets/CharacterPackets.cs b/Source/Game/Network/Packets/CharacterPackets.cs index 0af044e7b..b7d277f40 100644 --- a/Source/Game/Network/Packets/CharacterPackets.cs +++ b/Source/Game/Network/Packets/CharacterPackets.cs @@ -63,7 +63,7 @@ namespace Game.Network.Packets public bool Success; public bool IsDeletedCharacters; // used for character undelete list - public bool IsDemonHunterCreationAllowed = false; ///< used for demon hunter early access + public bool IsDemonHunterCreationAllowed = false; //used for demon hunter early access public bool HasDemonHunterOnRealm = false; public bool Unknown7x = false; public bool IsAlliedRacesCreationAllowed = false; @@ -72,7 +72,7 @@ namespace Game.Network.Packets public Optional DisabledClassesMask = new Optional(); public List Characters = new List(); // all characters on the list - public List RaceUnlockData = new List(); ///< + public List RaceUnlockData = new List(); // public class CharacterInfo { diff --git a/Source/Game/Network/Packets/GuildPackets.cs b/Source/Game/Network/Packets/GuildPackets.cs index 0c787357d..7cb98d718 100644 --- a/Source/Game/Network/Packets/GuildPackets.cs +++ b/Source/Game/Network/Packets/GuildPackets.cs @@ -716,7 +716,7 @@ namespace Game.Network.Packets } public ObjectGuid NoteeGUID; - public bool IsPublic; ///< 0 == Officer, 1 == Public + public bool IsPublic; // 0 == Officer, 1 == Public public string Note; } @@ -736,7 +736,7 @@ namespace Game.Network.Packets } public ObjectGuid Member; - public bool IsPublic; ///< 0 == Officer, 1 == Public + public bool IsPublic; // 0 == Officer, 1 == Public public string Note; } diff --git a/Source/Game/Network/Packets/InspectPackets.cs b/Source/Game/Network/Packets/InspectPackets.cs index add7954f7..d2089c09e 100644 --- a/Source/Game/Network/Packets/InspectPackets.cs +++ b/Source/Game/Network/Packets/InspectPackets.cs @@ -98,8 +98,8 @@ namespace Game.Network.Packets { _worldPacket.WritePackedGuid(PlayerGUID); _worldPacket.WriteUInt8(LifetimeMaxRank); - _worldPacket.WriteUInt16(YesterdayHK); /// @todo: confirm order - _worldPacket.WriteUInt16(TodayHK); /// @todo: confirm order + _worldPacket.WriteUInt16(YesterdayHK); // @todo: confirm order + _worldPacket.WriteUInt16(TodayHK); // @todo: confirm order _worldPacket.WriteUInt32(LifetimeHK); } @@ -184,7 +184,7 @@ namespace Game.Network.Packets Item = new ItemInstance(item); Index = index; - Usable = true; /// @todo + Usable = true; // @todo for (EnchantmentSlot enchant = 0; enchant < EnchantmentSlot.Max; ++enchant) { diff --git a/Source/Game/Network/Packets/ItemPackets.cs b/Source/Game/Network/Packets/ItemPackets.cs index 5b155a9d7..745fd8aa3 100644 --- a/Source/Game/Network/Packets/ItemPackets.cs +++ b/Source/Game/Network/Packets/ItemPackets.cs @@ -305,8 +305,8 @@ namespace Game.Network.Packets } public InvUpdate Inv; - public byte Slot1; /// Source Slot - public byte Slot2; /// Destination Slot + public byte Slot1; // Source Slot + public byte Slot2; // Destination Slot } public class SwapItem : ClientPacket diff --git a/Source/Game/Network/Packets/ReputationPackets.cs b/Source/Game/Network/Packets/ReputationPackets.cs index 757b5f625..4ba49bba7 100644 --- a/Source/Game/Network/Packets/ReputationPackets.cs +++ b/Source/Game/Network/Packets/ReputationPackets.cs @@ -41,7 +41,7 @@ namespace Game.Network.Packets } public int[] FactionStandings = new int[FactionCount]; - public bool[] FactionHasBonus = new bool[FactionCount]; ///< @todo: implement faction bonus + public bool[] FactionHasBonus = new bool[FactionCount]; //@todo: implement faction bonus public FactionFlags[] FactionFlags = new FactionFlags[FactionCount]; } diff --git a/Source/Game/Reputation/ReputationManager.cs b/Source/Game/Reputation/ReputationManager.cs index 612b9e3e1..5ab89111f 100644 --- a/Source/Game/Reputation/ReputationManager.cs +++ b/Source/Game/Reputation/ReputationManager.cs @@ -209,7 +209,7 @@ namespace Game { initFactions.FactionFlags[pair.Key] = pair.Value.Flags; initFactions.FactionStandings[pair.Key] = pair.Value.Standing; - /// @todo faction bonus + // @todo faction bonus pair.Value.needSend = false; } diff --git a/Source/Game/Server/WorldManager.cs b/Source/Game/Server/WorldManager.cs index 0be16abd7..149c3385d 100644 --- a/Source/Game/Server/WorldManager.cs +++ b/Source/Game/Server/WorldManager.cs @@ -859,7 +859,7 @@ namespace Game //to set mailtimer to return mails every day between 4 and 5 am //mailtimer is increased when updating auctions //one second is 1000 -(tested on win system) - /// @todo Get rid of magic numbers + // @todo Get rid of magic numbers var localTime = Time.UnixTimeToDateTime(m_gameTime).ToLocalTime(); mail_timer = ((((localTime.Hour + 20) % 24) * Time.Hour * Time.InMilliseconds) / m_timers[WorldTimers.Auctions].GetInterval()); //1440 @@ -1212,7 +1212,7 @@ namespace Game { m_timers[WorldTimers.Blackmarket].Reset(); - ///- Update blackmarket, refresh auctions if necessary + //- Update blackmarket, refresh auctions if necessary if ((blackmarket_timer * m_timers[WorldTimers.Blackmarket].GetInterval() >= WorldConfig.GetIntValue(WorldCfg.BlackmarketUpdatePeriod) * Time.Hour * Time.InMilliseconds) || blackmarket_timer == 0) { Global.BlackMarketMgr.RefreshAuctions(); @@ -1230,7 +1230,7 @@ namespace Game UpdateSessions(diff); RecordTimeDiff("UpdateSessions"); - ///
  • Update uptime table + //
  • Update uptime table if (m_timers[WorldTimers.UpTime].Passed()) { uint tmpDiff = (uint)(m_gameTime - m_startTime); @@ -1248,7 +1248,7 @@ namespace Game DB.Login.Execute(stmt); } - ///
  • Clean logs table + //
  • Clean logs table if (WorldConfig.GetIntValue(WorldCfg.LogdbCleartime) > 0) // if not enabled, ignore the timer { if (m_timers[WorldTimers.CleanDB].Passed()) @@ -1580,7 +1580,7 @@ namespace Game uint duration_secs = Time.TimeStringToSecs(duration); - /// Pick a player to ban if not online + // Pick a player to ban if not online if (!pBanned) { guid = ObjectManager.GetPlayerGUIDByName(name); diff --git a/Source/Game/Server/WorldSession.cs b/Source/Game/Server/WorldSession.cs index 5ee5f5023..8f34b8b50 100644 --- a/Source/Game/Server/WorldSession.cs +++ b/Source/Game/Server/WorldSession.cs @@ -69,7 +69,7 @@ namespace Game if (_player) LogoutPlayer(true); - /// - If have unclosed socket, close it + // - If have unclosed socket, close it for (byte i = 0; i < 2; ++i) { if (m_Socket[i] != null) @@ -633,7 +633,7 @@ namespace Game _accountLoginCallback = null; } - //! HandlePlayerLoginOpcode + // HandlePlayerLoginOpcode if (_charLoginCallback != null && _charLoginCallback.IsCompleted) { HandlePlayerLogin((LoginQueryHolder)_charLoginCallback.Result); diff --git a/Source/Game/Spells/Auras/Aura.cs b/Source/Game/Spells/Auras/Aura.cs index 86bf70893..1de4246da 100644 --- a/Source/Game/Spells/Auras/Aura.cs +++ b/Source/Game/Spells/Auras/Aura.cs @@ -388,7 +388,7 @@ namespace Game.Spells var app = m_applications.LookupByKey(target.GetGUID()); - /// @todo Figure out why this happens + // @todo Figure out why this happens if (app == null) { Log.outError(LogFilter.Spells, "Aura._UnapplyForTarget, target: {0}, caster: {1}, spell: {2} was not found in owners application map!", @@ -537,7 +537,7 @@ namespace Game.Spells // owner has to be in world, or effect has to be applied to self if (!m_owner.IsSelfOrInSameMap(unit)) { - /// @todo There is a crash caused by shadowfiend load addon + // @todo There is a crash caused by shadowfiend load addon Log.outFatal(LogFilter.Spells, "Aura {0}: Owner {1} (map {2}) is not in the same map as target {3} (map {4}).", GetSpellInfo().Id, m_owner.GetName(), m_owner.IsInWorld ? (int)m_owner.GetMap().GetId() : -1, unit.GetName(), unit.IsInWorld ? (int)unit.GetMap().GetId() : -1); @@ -1706,7 +1706,7 @@ namespace Game.Spells if (procEffectMask == 0) return 0; - /// @todo + // @todo // do allow additional requirements for procs // this is needed because this is the last moment in which you can prevent aura charge drop on proc // and possibly a way to prevent default checks (if there're going to be any) @@ -1720,7 +1720,7 @@ namespace Game.Spells // Check if current equipment meets aura requirements // do that only for passive spells - /// @todo this needs to be unified for all kinds of auras + // @todo this needs to be unified for all kinds of auras Unit target = aurApp.GetTarget(); if (IsPassive() && target.IsTypeId(TypeId.Player)) { @@ -2039,9 +2039,7 @@ namespace Game.Spells if (eff.IsEffectAffected(m_spellInfo, aurEff.GetEffIndex())) eff.Call(aurEff, dmgInfo, ref absorbAmount); - if (!defaultPrevented) - defaultPrevented = auraScript._IsDefaultActionPrevented(); - + defaultPrevented = auraScript._IsDefaultActionPrevented(); auraScript._FinishScriptCall(); } } @@ -2060,7 +2058,7 @@ namespace Game.Spells } } - public void CallScriptEffectManaShieldHandlers(AuraEffect aurEff, AuraApplication aurApp, DamageInfo dmgInfo, ref uint absorbAmount, bool defaultPrevented) + public void CallScriptEffectManaShieldHandlers(AuraEffect aurEff, AuraApplication aurApp, DamageInfo dmgInfo, ref uint absorbAmount, ref bool defaultPrevented) { foreach (var auraScript in m_loadedScripts) { diff --git a/Source/Game/Spells/Auras/AuraEffect.cs b/Source/Game/Spells/Auras/AuraEffect.cs index 255bea8aa..fb526489f 100644 --- a/Source/Game/Spells/Auras/AuraEffect.cs +++ b/Source/Game/Spells/Auras/AuraEffect.cs @@ -1938,7 +1938,7 @@ namespace Game.Spells Unit target = aurApp.GetTarget(); // Vengeance of the Blue Flight (@todo REMOVE THIS!) - /// @workaround + // @workaround if (m_spellInfo.Id == 45839) { if (apply) @@ -4985,7 +4985,7 @@ namespace Game.Spells HealInfo healInfo = new HealInfo(caster, target, heal, auraSpellInfo, auraSpellInfo.GetSchoolMask()); caster.HealBySpell(healInfo); - /// @todo: should proc other auras? + // @todo: should proc other auras? int mana = caster.GetMaxPower(PowerType.Mana); if (mana != 0) { @@ -5044,7 +5044,7 @@ namespace Game.Spells triggerSpellId = 30571; break; // Doom - /// @todo effect trigger spell may be independant on spell targets, and executed in spell finish phase + // @todo effect trigger spell may be independant on spell targets, and executed in spell finish phase // so instakill will be naturally done before trigger spell case 31347: { diff --git a/Source/Game/Spells/Spell.cs b/Source/Game/Spells/Spell.cs index 9b8db6022..4e9ff4155 100644 --- a/Source/Game/Spells/Spell.cs +++ b/Source/Game/Spells/Spell.cs @@ -778,7 +778,7 @@ namespace Game.Spells SpellTargetPosition st = Global.SpellMgr.GetSpellTargetPosition(m_spellInfo.Id, effIndex); if (st != null) { - /// @todo fix this check + // @todo fix this check if (m_spellInfo.HasEffect(SpellEffectName.TeleportUnits) || m_spellInfo.HasEffect(SpellEffectName.Bind)) dest = new SpellDestination(st.target_X, st.target_Y, st.target_Z, st.target_Orientation, st.target_mapId); else if (st.target_mapId == m_caster.GetMapId()) @@ -1244,7 +1244,7 @@ namespace Game.Spells void SelectEffectTypeImplicitTargets(uint effIndex) { // special case for SPELL_EFFECT_SUMMON_RAF_FRIEND and SPELL_EFFECT_SUMMON_PLAYER - /// @todo this is a workaround - target shouldn't be stored in target map for those spells + // @todo this is a workaround - target shouldn't be stored in target map for those spells SpellEffectInfo effect = GetEffect(effIndex); if (effect == null) return; @@ -1670,7 +1670,7 @@ namespace Game.Spells if (m_spellInfo.Speed > 0.0f && m_caster != target) { // calculate spell incoming interval - /// @todo this is a hack + // @todo this is a hack float dist = m_caster.GetDistance(target.GetPositionX(), target.GetPositionY(), target.GetPositionZ()); if (dist < 5.0f) @@ -2132,7 +2132,7 @@ namespace Game.Spells else if (m_caster.IsFriendlyTo(unit)) { // for delayed spells ignore negative spells (after duel end) for friendly targets - /// @todo this cause soul transfer bugged + // @todo this cause soul transfer bugged // 63881 - Malady of the Mind jump spell (Yogg-Saron) if (m_spellInfo.Speed > 0.0f && unit.IsTypeId(TypeId.Player) && !m_spellInfo.IsPositive() && m_spellInfo.Id != 63881) return SpellMissInfo.Evade; @@ -4089,7 +4089,7 @@ namespace Game.Spells resurrectRequest.SpellID = m_spellInfo.Id; - //packet.ReadBit("UseTimer"); /// @todo: 6.x Has to be implemented + //packet.ReadBit("UseTimer"); // @todo: 6.x Has to be implemented resurrectRequest.Sickness = !m_caster.IsTypeId(TypeId.Player); // "you'll be afflicted with resurrection sickness" resurrectRequest.Name = sentName; diff --git a/Source/Game/Spells/SpellHistory.cs b/Source/Game/Spells/SpellHistory.cs index 4a7842941..4d3c27f88 100644 --- a/Source/Game/Spells/SpellHistory.cs +++ b/Source/Game/Spells/SpellHistory.cs @@ -972,12 +972,5 @@ namespace Game.Spells public DateTime RechargeStart; public DateTime RechargeEnd; } - - class CooldownDurations - { - public int Cooldown = -1; - public uint CategoryId = 0; - public int CategoryCooldown = -1; - } } } diff --git a/Source/Game/Spells/SpellManager.cs b/Source/Game/Spells/SpellManager.cs index c93417267..083474ecb 100644 --- a/Source/Game/Spells/SpellManager.cs +++ b/Source/Game/Spells/SpellManager.cs @@ -658,8 +658,8 @@ namespace Game.Entities SpellInfo first = GetSpellInfo(pair.Key); SpellInfo next = GetSpellInfo(pair.Value); - if (first == null || next != null) - continue; + if (!mSpellChains.ContainsKey(pair.Key)) + mSpellChains[pair.Key] = new SpellChainNode(); mSpellChains[pair.Key].first = first; mSpellChains[pair.Key].prev = null; @@ -668,6 +668,9 @@ namespace Game.Entities mSpellChains[pair.Key].rank = 1; mSpellInfoMap[pair.Key].ChainEntry = mSpellChains[pair.Key]; + if (!mSpellChains.ContainsKey(pair.Value)) + mSpellChains[pair.Value] = new SpellChainNode(); + mSpellChains[pair.Value].first = first; mSpellChains[pair.Value].prev = first; mSpellChains[pair.Value].next = null; @@ -684,8 +687,14 @@ namespace Game.Entities if (last == null) break; + if (!mSpellChains.ContainsKey(nextPair.Key)) + mSpellChains[nextPair.Key] = new SpellChainNode(); + mSpellChains[nextPair.Key].next = last; + if (!mSpellChains.ContainsKey(nextPair.Value)) + mSpellChains[nextPair.Value] = new SpellChainNode(); + mSpellChains[nextPair.Value].first = first; mSpellChains[nextPair.Value].prev = prev; mSpellChains[nextPair.Value].next = null; @@ -2433,7 +2442,7 @@ namespace Game.Entities break; case 56606: // Ride Jokkum case 61791: // Ride Vehicle (Yogg-Saron) - /// @todo: remove this when basepoints of all Ride Vehicle auras are calculated correctly + // @todo: remove this when basepoints of all Ride Vehicle auras are calculated correctly spellInfo.GetEffect(0).BasePoints = 1; break; case 59630: // Black Magic diff --git a/Source/Game/Warden/WardenWin.cs b/Source/Game/Warden/WardenWin.cs index f853c5aea..046a58702 100644 --- a/Source/Game/Warden/WardenWin.cs +++ b/Source/Game/Warden/WardenWin.cs @@ -314,7 +314,7 @@ namespace Game // TIMING_CHECK { byte result = buff.ReadUInt8(); - /// @todo test it. + // @todo test it. if (result == 0x00) { Log.outWarn(LogFilter.Warden, "{0} failed timing check. Action: {1}", _session.GetPlayerInfo(), Penalty()); diff --git a/Source/Game/Weather/WeatherManager.cs b/Source/Game/Weather/WeatherManager.cs index 7695429ff..59ead191e 100644 --- a/Source/Game/Weather/WeatherManager.cs +++ b/Source/Game/Weather/WeatherManager.cs @@ -136,7 +136,7 @@ namespace Game return false; } - /// Weather statistics: + // Weather statistics: // 30% - no change // 30% - weather gets better (if not fine) or change weather type // 30% - weather worsens (if not fine) @@ -178,7 +178,7 @@ namespace Game if (m_type != WeatherType.Fine) { - /// Radical change: + // Radical change: // if light . heavy // if medium . change weather type // if heavy . 50% light, 50% change weather type diff --git a/Source/Scripts/EasternKingdoms/Karazhan/InstanceKarazhan.cs b/Source/Scripts/EasternKingdoms/Karazhan/InstanceKarazhan.cs index 80420a390..914c031d8 100644 --- a/Source/Scripts/EasternKingdoms/Karazhan/InstanceKarazhan.cs +++ b/Source/Scripts/EasternKingdoms/Karazhan/InstanceKarazhan.cs @@ -318,7 +318,7 @@ namespace Scripts.EasternKingdoms.Karazhan switch (m_uiOperaEvent) { - /// @todo Set Object visibilities for Opera based on performance + // @todo Set Object visibilities for Opera based on performance case OperaEvents.Oz: break; diff --git a/Source/Scripts/Kalimdor/ZoneAshenvale.cs b/Source/Scripts/Kalimdor/ZoneAshenvale.cs index a047893b7..6e62e34fe 100644 --- a/Source/Scripts/Kalimdor/ZoneAshenvale.cs +++ b/Source/Scripts/Kalimdor/ZoneAshenvale.cs @@ -134,7 +134,7 @@ namespace Scripts.Kalimdor.ZoneAshenvale if (quest.Id == QuestIds.FreedomToRuul) { me.SetFaction(Misc.FactionQuest); - base.Start(true, false, player.GetGUID()); + Start(true, false, player.GetGUID()); } } @@ -224,7 +224,7 @@ namespace Scripts.Kalimdor.ZoneAshenvale { Talk(TextIds.SayMugStart1); me.SetFaction(Misc.FactionQuest); - base.Start(true, false, player.GetGUID()); + Start(true, false, player.GetGUID()); } } diff --git a/Source/Scripts/Northrend/AzjolNerub/Ahnkahet/BossElderNadox.cs b/Source/Scripts/Northrend/AzjolNerub/Ahnkahet/BossElderNadox.cs index 089ba596c..bcf340eaf 100644 --- a/Source/Scripts/Northrend/AzjolNerub/Ahnkahet/BossElderNadox.cs +++ b/Source/Scripts/Northrend/AzjolNerub/Ahnkahet/BossElderNadox.cs @@ -86,7 +86,7 @@ namespace Scripts.Northrend.AzjolNerub.Ahnkahet.ElderNadox _scheduler.Schedule(TimeSpan.FromSeconds(10), task => { - /// @todo: summoned by egg + // @todo: summoned by egg DoCast(me, SpellIds.SummonSwarmers); if (RandomHelper.URand(1, 3) == 3) // 33% chance of dialog Talk(TextIds.SayEggSac); @@ -147,7 +147,7 @@ namespace Scripts.Northrend.AzjolNerub.Ahnkahet.ElderNadox if (!GuardianSummoned && me.HealthBelowPct(50)) { - /// @todo: summoned by egg + // @todo: summoned by egg Talk(TextIds.EmoteHatches, me); DoCast(me, SpellIds.SummonSwarmGuard); GuardianSummoned = true; diff --git a/Source/Scripts/Northrend/AzjolNerub/Ahnkahet/BossPrinceTaldaram.cs b/Source/Scripts/Northrend/AzjolNerub/Ahnkahet/BossPrinceTaldaram.cs index 68c5e4548..728676941 100644 --- a/Source/Scripts/Northrend/AzjolNerub/Ahnkahet/BossPrinceTaldaram.cs +++ b/Source/Scripts/Northrend/AzjolNerub/Ahnkahet/BossPrinceTaldaram.cs @@ -316,7 +316,7 @@ namespace Scripts.Northrend.AzjolNerub.Ahnkahet.PrinceTaldaram { DoCast(me, SpellIds.FlameSpherePeriodic, true); - /// @todo: find correct values + // @todo: find correct values float angleOffset = 0.0f; float distOffset = Misc.DataSphereDistance; @@ -342,7 +342,7 @@ namespace Scripts.Northrend.AzjolNerub.Ahnkahet.PrinceTaldaram float x = me.GetPositionX() + distOffset * (float)Math.Cos(angle); float y = me.GetPositionY() + distOffset * (float)Math.Sin(angle); - /// @todo: correct speed + // @todo: correct speed me.GetMotionMaster().MovePoint(0, x, y, me.GetPositionZ()); break; } diff --git a/Source/Scripts/Northrend/FrozenHalls/PitOfSaron/BossKrickAndIck.cs b/Source/Scripts/Northrend/FrozenHalls/PitOfSaron/BossKrickAndIck.cs index c927cd0d9..41d6c5587 100644 --- a/Source/Scripts/Northrend/FrozenHalls/PitOfSaron/BossKrickAndIck.cs +++ b/Source/Scripts/Northrend/FrozenHalls/PitOfSaron/BossKrickAndIck.cs @@ -447,7 +447,7 @@ namespace Scripts.Northrend.FrozenHalls.PitOfSaron.BossKrickAndIck case Events.Outro9: { Talk(TextIds.SayKrickOutro8); - /// @todo Tyrannus starts killing Krick. + // @todo Tyrannus starts killing Krick. // there shall be some visual spell effect Creature tyrannus = ObjectAccessor.GetCreature(me, _tyrannusGUID); if (tyrannus) diff --git a/Source/Scripts/Northrend/Nexus/EyeOfEternity/EyeOfEternity.cs b/Source/Scripts/Northrend/Nexus/EyeOfEternity/EyeOfEternity.cs index 1a1632b0b..ffa13d259 100644 --- a/Source/Scripts/Northrend/Nexus/EyeOfEternity/EyeOfEternity.cs +++ b/Source/Scripts/Northrend/Nexus/EyeOfEternity/EyeOfEternity.cs @@ -139,7 +139,7 @@ namespace Scripts.Northrend.Nexus.EyeOfEternity return true; } - /// @todo this should be handled in map, maybe add a summon function in map + // @todo this should be handled in map, maybe add a summon function in map // There is no other way afaik... void SpawnGameObject(uint entry, Position pos) { diff --git a/Source/Scripts/Northrend/Nexus/Nexus/BossKeristrasza.cs b/Source/Scripts/Northrend/Nexus/Nexus/BossKeristrasza.cs index 33a10a492..854ae41ba 100644 --- a/Source/Scripts/Northrend/Nexus/Nexus/BossKeristrasza.cs +++ b/Source/Scripts/Northrend/Nexus/Nexus/BossKeristrasza.cs @@ -220,7 +220,7 @@ namespace Scripts.Northrend.Nexus.Nexus if (aurEff.GetBase().GetStackAmount() < 2) return; Unit caster = GetCaster(); - /// @todo the caster should be boss but not the player + // @todo the caster should be boss but not the player if (!caster || caster.GetAI() == null) return; diff --git a/Source/Scripts/Northrend/Ulduar/FlameLeviathan.cs b/Source/Scripts/Northrend/Ulduar/FlameLeviathan.cs index 79adfa599..536b2732d 100644 --- a/Source/Scripts/Northrend/Ulduar/FlameLeviathan.cs +++ b/Source/Scripts/Northrend/Ulduar/FlameLeviathan.cs @@ -1058,7 +1058,7 @@ namespace Scripts.Northrend.Ulduar.FlameLeviathan { brann.RemoveFlag(UnitFields.NpcFlags, NPCFlags.Gossip); delorah.GetMotionMaster().MovePoint(0, brann.GetPositionX() - 4, brann.GetPositionY(), brann.GetPositionZ()); - /// @todo delorah->AI()->Talk(xxxx, brann->GetGUID()); when reached at branz + // @todo delorah->AI()->Talk(xxxx, brann->GetGUID()); when reached at branz } } } @@ -1388,7 +1388,7 @@ namespace Scripts.Northrend.Ulduar.FlameLeviathan void FilterTargets(List targets) { - targets.RemoveAll(new Predicate(target => + targets.RemoveAll(target => { //! No players, only vehicles (@todo check if blizzlike) Creature creatureTarget = target.ToCreature(); @@ -1420,7 +1420,7 @@ namespace Scripts.Northrend.Ulduar.FlameLeviathan } return !playerFound; - })); + }); if (targets.Empty()) { diff --git a/Source/Scripts/Northrend/Ulduar/Mimiron.cs b/Source/Scripts/Northrend/Ulduar/Mimiron.cs index e3840aa6f..20139a1fc 100644 --- a/Source/Scripts/Northrend/Ulduar/Mimiron.cs +++ b/Source/Scripts/Northrend/Ulduar/Mimiron.cs @@ -176,7 +176,7 @@ namespace Scripts.Northrend.Ulduar public const uint MagneticCore = 64436; public const uint MagneticCoreVisual = 64438; public const uint HalfHeal = 64188; - public const uint ClearAllDebuffs = 34098; /// @Todo: Make Use Of This Spell... + public const uint ClearAllDebuffs = 34098; // @Todo: Make Use Of This Spell... public const uint FreezeAnimStun = 63354; // Used To Prevent Mkii From Doing Stuff?.. public const uint FreezeAnim = 16245; // Idle Aura. Freezes Animation. } diff --git a/Source/Scripts/Outlands/HellfirePeninsula.cs b/Source/Scripts/Outlands/HellfirePeninsula.cs index da88911fa..4b7dacca9 100644 --- a/Source/Scripts/Outlands/HellfirePeninsula.cs +++ b/Source/Scripts/Outlands/HellfirePeninsula.cs @@ -190,7 +190,7 @@ namespace Scripts.Outlands if (quest.Id == QUEST_ROAD_TO_FALCON_WATCH) { me.SetFaction(FACTION_FALCON_WATCH_QUEST); - base.Start(true, false, player.GetGUID()); + Start(true, false, player.GetGUID()); } } diff --git a/Source/Scripts/Spells/Generic.cs b/Source/Scripts/Spells/Generic.cs index 0db95d8f2..ba6a62af5 100644 --- a/Source/Scripts/Spells/Generic.cs +++ b/Source/Scripts/Spells/Generic.cs @@ -2451,7 +2451,7 @@ namespace Scripts.Spells.Generic { Unit owner = GetCaster().GetOwner(); if (owner) - if (owner.IsTypeId(TypeId.Player)) /// @todo this check is maybe wrong + if (owner.IsTypeId(TypeId.Player)) // @todo this check is maybe wrong owner.ToPlayer().RemovePet(null, PetSaveMode.NotInSlot, true); } } @@ -2757,7 +2757,7 @@ namespace Scripts.Spells.Generic float factor; ushort baseItemLevel; - /// @todo Reserach coeffs for different vehicles + // @todo Reserach coeffs for different vehicles switch (GetId()) { case SpellIds.GearScaling: @@ -2772,7 +2772,7 @@ namespace Scripts.Spells.Generic float avgILvl = caster.ToPlayer().GetAverageItemLevel(); if (avgILvl < baseItemLevel) - return; /// @todo Research possibility of scaling down + return; // @todo Research possibility of scaling down amount = (int)((avgILvl - baseItemLevel) * factor); } diff --git a/Source/Scripts/Spells/Hunter.cs b/Source/Scripts/Spells/Hunter.cs index c92ceeb98..0ebd13be6 100644 --- a/Source/Scripts/Spells/Hunter.cs +++ b/Source/Scripts/Spells/Hunter.cs @@ -433,7 +433,7 @@ namespace Scripts.Spells.Hunter { SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(p.Key); - ///! If spellId in cooldown map isn't valid, the above will return a null pointer. + //! If spellId in cooldown map isn't valid, the above will return a null pointer. if (spellInfo.SpellFamilyName == SpellFamilyNames.Hunter && spellInfo.Id != SpellIds.Readiness && spellInfo.Id != SpellIds.BestialWrath && diff --git a/Source/Scripts/Spells/Priest.cs b/Source/Scripts/Spells/Priest.cs index f987a3d7a..d382eec52 100644 --- a/Source/Scripts/Spells/Priest.cs +++ b/Source/Scripts/Spells/Priest.cs @@ -255,14 +255,14 @@ namespace Scripts.Spells.Priest void FilterTargets(List targets) { - targets.RemoveAll(new Predicate(obj => + targets.RemoveAll(obj => { Unit target = obj.ToUnit(); if (target) return !GetCaster().IsInRaidWith(target); return true; - })); + }); uint maxTargets = (uint)(GetCaster().HasAura(SpellIds.GlyphOfCircleOfHealing) ? 6 : 5); // Glyph of Circle of Healing @@ -368,14 +368,14 @@ namespace Scripts.Spells.Priest { void FilterTargets(List targets) { - targets.RemoveAll(new Predicate(obj => + targets.RemoveAll(obj => { Unit target = obj.ToUnit(); if (target) return !GetCaster().IsInRaidWith(target); return true; - })); + }); uint maxTargets = 3; @@ -492,23 +492,23 @@ namespace Scripts.Spells.Priest { void FilterTargets(List targets) { - targets.RemoveAll(new Predicate(obj => + targets.RemoveAll(obj => { Unit target = obj.ToUnit(); if (target) return target.GetPowerType() != PowerType.Mana; return true; - })); + }); - targets.RemoveAll(new Predicate(obj => + targets.RemoveAll(obj => { Unit target = obj.ToUnit(); if (target) return !GetCaster().IsInRaidWith(target); return true; - })); + }); uint maxTargets = 3; diff --git a/Source/Scripts/Spells/Warrior.cs b/Source/Scripts/Spells/Warrior.cs index 7408179c8..1f8da69da 100644 --- a/Source/Scripts/Spells/Warrior.cs +++ b/Source/Scripts/Spells/Warrior.cs @@ -367,7 +367,7 @@ namespace Scripts.Spells.Warrior } // 70844 - Item - Warrior T10 Protection 4P Bonus - [Script] /// 7.1.5 + [Script] // 7.1.5 class spell_warr_item_t10_prot_4p_bonus : AuraScript { public override bool Validate(SpellInfo spellInfo) diff --git a/Source/Scripts/World/GameObjects.cs b/Source/Scripts/World/GameObjects.cs index 22fd2d0ca..50b490d90 100644 --- a/Source/Scripts/World/GameObjects.cs +++ b/Source/Scripts/World/GameObjects.cs @@ -304,7 +304,7 @@ namespace Scripts.World { public go_tablet_of_the_seven() : base("go_tablet_of_the_seven") { } - /// @todo use gossip option ("Transcript the Tablet") instead, if Trinity adds support. + // @todo use gossip option ("Transcript the Tablet") instead, if Trinity adds support. public override bool OnGossipHello(Player player, GameObject go) { if (go.GetGoType() != GameObjectTypes.QuestGiver) @@ -799,7 +799,7 @@ namespace Scripts.World if (!pPrisoner || !pPrisoner.IsAlive()) return true; - /// @todo prisoner should help player for a short period of time + // @todo prisoner should help player for a short period of time player.KilledMonsterCredit(GameobjectConst.NpcCapturedValgardePrisonerProxy); pPrisoner.DespawnOrUnsummon(); return true;