Core/Refactor: Part 3

This commit is contained in:
hondacrx
2018-05-16 19:57:48 -04:00
parent 225a5d27f7
commit 5dacd669b5
112 changed files with 564 additions and 561 deletions
+1 -1
View File
@@ -290,7 +290,7 @@ namespace System.Collections
{ {
Contract.Ensures(Contract.Result<int>() >= 0); Contract.Ensures(Contract.Result<int>() >= 0);
return (int)_mLength; return _mLength;
} }
} }
+3 -3
View File
@@ -31,10 +31,10 @@ namespace Framework.Constants
{ {
None = 0x00, None = 0x00,
Read = 0x01, Read = 0x01,
Returned = 0x02, /// This Mail Was Returned. Do Not Allow Returning Mail Back Again. 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. Copied = 0x04, // This Mail Was Copied. Do Not Allow Making A Copy Of Items In Mail.
CodPayment = 0x08, CodPayment = 0x08,
HasBody = 0x10 /// This Mail Has Body Text. HasBody = 0x10 // This Mail Has Body Text.
} }
public enum MailStationery public enum MailStationery
+3 -3
View File
@@ -323,9 +323,9 @@ namespace Framework.Constants
SavePlayer = 0x01, SavePlayer = 0x01,
ResurrectPlayer = 0x02, ResurrectPlayer = 0x02,
SpellCastDeserter = 0x04, SpellCastDeserter = 0x04,
BGMountRestore = 0x08, ///< Flag to restore mount 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 BGTaxiRestore = 0x10, // Flag to restore taxi state after teleport from BG
BGGroupRestore = 0x20, ///< Flag to restore group state after teleport from BG BGGroupRestore = 0x20, // Flag to restore group state after teleport from BG
End End
} }
+6
View File
@@ -483,6 +483,12 @@ namespace Framework.Constants
ChaseMove = 0x4000000, ChaseMove = 0x4000000,
FollowMove = 0x8000000, FollowMove = 0x8000000,
IgnorePathfinding = 0x10000000, 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, Unattackable = InFlight,
// For Real Move Using Movegen Check And Stop (Except Unstoppable Flight) // For Real Move Using Movegen Check And Stop (Except Unstoppable Flight)
Moving = RoamingMove | ConfusedMove | FleeingMove | ChaseMove | FollowMove, Moving = RoamingMove | ConfusedMove | FleeingMove | ChaseMove | FollowMove,
+2 -1
View File
@@ -52,7 +52,7 @@ namespace Framework.Database
public QueryCallbackStatus InvokeIfReady() public QueryCallbackStatus InvokeIfReady()
{ {
QueryCallbackData callback = _callbacks.Dequeue(); QueryCallbackData callback = _callbacks.Peek();
while (true) while (true)
{ {
@@ -64,6 +64,7 @@ namespace Framework.Database
cb(this, f.Result); cb(this, f.Result);
_callbacks.Dequeue();
bool hasNext = _result != null; bool hasNext = _result != null;
if (_callbacks.Count == 0) if (_callbacks.Count == 0)
{ {
@@ -78,6 +78,7 @@ namespace Framework.Dynamic
/// Calls the optional callback on successfully finish. /// Calls the optional callback on successfully finish.
/// </summary> /// </summary>
/// <param name="milliseconds"></param> /// <param name="milliseconds"></param>
/// <param name="callback"></param>
/// <returns></returns> /// <returns></returns>
public TaskScheduler Update(uint milliseconds, success_t callback = null) public TaskScheduler Update(uint milliseconds, success_t callback = null)
{ {
@@ -89,6 +90,7 @@ namespace Framework.Dynamic
/// Calls the optional callback on successfully finish. /// Calls the optional callback on successfully finish.
/// </summary> /// </summary>
/// <param name="difftime"></param> /// <param name="difftime"></param>
/// <param name="callback"></param>
/// <returns></returns> /// <returns></returns>
TaskScheduler Update(TimeSpan difftime, success_t callback = null) TaskScheduler Update(TimeSpan difftime, success_t callback = null)
{ {
+1 -1
View File
@@ -236,7 +236,7 @@ namespace Framework.GameMath
/// the specified object. /// the specified object.
/// </summary> /// </summary>
/// <param name="obj">An object to compare to this instance.</param> /// <param name="obj">An object to compare to this instance.</param>
/// <returns>True if <paramref name="obj"/> is a <see cref="Vector2D"/> and has the same values as this instance; otherwise, False.</returns> /// <returns>True if <paramref name="obj"/> is a <see cref="Plane"/> and has the same values as this instance; otherwise, False.</returns>
public override bool Equals(object obj) public override bool Equals(object obj)
{ {
if (obj is Plane) if (obj is Plane)
+5 -5
View File
@@ -258,7 +258,7 @@ namespace Framework.GameMath
/// Converts the specified string to its <see cref="Quaternion"/> equivalent. /// Converts the specified string to its <see cref="Quaternion"/> equivalent.
/// </summary> /// </summary>
/// <param name="value">A string representation of a <see cref="Quaternion"/></param> /// <param name="value">A string representation of a <see cref="Quaternion"/></param>
/// <returns>A <see cref="Quaternion"/> that represents the vector specified by the <paramref name="s"/> parameter.</returns> /// <returns>A <see cref="Quaternion"/> that represents the vector specified by the <paramref name="value"/> parameter.</returns>
public static Quaternion Parse(string value) public static Quaternion Parse(string value)
{ {
Regex r = new Regex(@"\((?<w>.*),(?<x>.*),(?<y>.*),(?<z>.*)\)", RegexOptions.None); Regex r = new Regex(@"\((?<w>.*),(?<x>.*),(?<y>.*),(?<z>.*)\)", RegexOptions.None);
@@ -358,7 +358,7 @@ namespace Framework.GameMath
} }
/// <summary> /// <summary>
/// Multiplies quaternion <paramref name="a"/> by quaternion <paramref name="b"/>. /// Multiplies quaternion <paramref name="left"/> by quaternion <paramref name="right"/>.
/// </summary> /// </summary>
/// <param name="left">A <see cref="Quaternion"/> instance.</param> /// <param name="left">A <see cref="Quaternion"/> instance.</param>
/// <param name="right">A <see cref="Quaternion"/> instance.</param> /// <param name="right">A <see cref="Quaternion"/> instance.</param>
@@ -374,7 +374,7 @@ namespace Framework.GameMath
return result; return result;
} }
/// <summary> /// <summary>
/// Multiplies quaternion <paramref name="a"/> by quaternion <paramref name="b"/> and put the result in a third quaternion. /// Multiplies quaternion <paramref name="left"/> by quaternion <paramref name="right"/> and put the result in a third quaternion.
/// </summary> /// </summary>
/// <param name="left">A <see cref="Quaternion"/> instance.</param> /// <param name="left">A <see cref="Quaternion"/> instance.</param>
/// <param name="right">A <see cref="Quaternion"/> instance.</param> /// <param name="right">A <see cref="Quaternion"/> instance.</param>
@@ -617,7 +617,7 @@ namespace Framework.GameMath
/// </summary> /// </summary>
/// <remarks> /// <remarks>
/// The quaternion values that are close to zero within the given tolerance are set to zero. /// The quaternion values that are close to zero within the given tolerance are set to zero.
/// The tolerance value used is <see cref="MathFunctions.EpsilonD"/> /// The tolerance value used is <see cref="MathFunctions.Epsilon"/>
/// </remarks> /// </remarks>
public void ClampZero() public void ClampZero()
{ {
@@ -707,7 +707,7 @@ namespace Framework.GameMath
return Quaternion.Subtract(left, right); return Quaternion.Subtract(left, right);
} }
/// <summary> /// <summary>
/// Multiplies quaternion <paramref name="a"/> by quaternion <paramref name="b"/>. /// Multiplies quaternion <paramref name="left"/> by quaternion <paramref name="right"/>.
/// </summary> /// </summary>
/// <param name="left">A <see cref="Quaternion"/> instance.</param> /// <param name="left">A <see cref="Quaternion"/> instance.</param>
/// <param name="right">A <see cref="Quaternion"/> instance.</param> /// <param name="right">A <see cref="Quaternion"/> instance.</param>
-1
View File
@@ -285,7 +285,6 @@ namespace Framework.GameMath
/// <param name="culture">The <see cref="System.Globalization.CultureInfo"/> to use as the current culture. </param> /// <param name="culture">The <see cref="System.Globalization.CultureInfo"/> to use as the current culture. </param>
/// <param name="value">The <see cref="Object"/> to convert.</param> /// <param name="value">The <see cref="Object"/> to convert.</param>
/// <returns>An <see cref="Object"/> that represents the converted value.</returns> /// <returns>An <see cref="Object"/> that represents the converted value.</returns>
/// <exception cref="ParseException">Failed parsing from string.</exception>
public override object ConvertFrom(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value) public override object ConvertFrom(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value)
{ {
if (value.GetType() == typeof(string)) if (value.GetType() == typeof(string))
+5 -6
View File
@@ -530,7 +530,7 @@ namespace Framework.GameMath
/// </summary> /// </summary>
/// <remarks> /// <remarks>
/// The vector values that are close to zero within the given tolerance are set to zero. /// The vector values that are close to zero within the given tolerance are set to zero.
/// The tolerance value used is <see cref="MathFunctions.EpsilonD"/> /// The tolerance value used is <see cref="MathFunctions.Epsilon"/>
/// </remarks> /// </remarks>
public void ClampZero() public void ClampZero()
{ {
@@ -825,10 +825,10 @@ namespace Framework.GameMath
return array; return array;
} }
/// <summary> /// <summary>
/// Converts the vector to a <see cref="System.Collections.Generic.List"/> of single-precision floating point values. /// Converts the vector to a <see cref="System.Collections.Generic.List{T}"/> of single-precision floating point values.
/// </summary> /// </summary>
/// <param name="vector">A <see cref="Vector2"/> instance.</param> /// <param name="vector">A <see cref="Vector2"/> instance.</param>
/// <returns>A <see cref="System.Collections.Generic.List"/> of single-precision floating point values.</returns> /// <returns>A <see cref="System.Collections.Generic.List{T}"/> of single-precision floating point values.</returns>
public static explicit operator List<float>(Vector2 vector) public static explicit operator List<float>(Vector2 vector)
{ {
List<float> list = new List<float>(); List<float> list = new List<float>();
@@ -838,10 +838,10 @@ namespace Framework.GameMath
return list; return list;
} }
/// <summary> /// <summary>
/// Converts the vector to a <see cref="System.Collections.Generic.LinkedList"/> of single-precision floating point values. /// Converts the vector to a <see cref="System.Collections.Generic.LinkedList{T}"/> of single-precision floating point values.
/// </summary> /// </summary>
/// <param name="vector">A <see cref="Vector2"/> instance.</param> /// <param name="vector">A <see cref="Vector2"/> instance.</param>
/// <returns>A <see cref="System.Collections.Generic.LinkedList"/> of single-precision floating point values.</returns> /// <returns>A <see cref="System.Collections.Generic.LinkedList{T}"/> of single-precision floating point values.</returns>
public static explicit operator LinkedList<float>(Vector2 vector) public static explicit operator LinkedList<float>(Vector2 vector)
{ {
LinkedList<float> list = new LinkedList<float>(); LinkedList<float> list = new LinkedList<float>();
@@ -910,7 +910,6 @@ namespace Framework.GameMath
/// <param name="culture">The <see cref="System.Globalization.CultureInfo"/> to use as the current culture. </param> /// <param name="culture">The <see cref="System.Globalization.CultureInfo"/> to use as the current culture. </param>
/// <param name="value">The <see cref="Object"/> to convert.</param> /// <param name="value">The <see cref="Object"/> to convert.</param>
/// <returns>An <see cref="Object"/> that represents the converted value.</returns> /// <returns>An <see cref="Object"/> that represents the converted value.</returns>
/// <exception cref="ParseException">Failed parsing from string.</exception>
public override object ConvertFrom(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value) public override object ConvertFrom(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value)
{ {
if (value.GetType() == typeof(string)) if (value.GetType() == typeof(string))
+5 -6
View File
@@ -554,7 +554,7 @@ namespace Framework.GameMath
/// </summary> /// </summary>
/// <remarks> /// <remarks>
/// The vector values that are close to zero within the given tolerance are set to zero. /// The vector values that are close to zero within the given tolerance are set to zero.
/// The tolerance value used is <see cref="MathFunctions.EpsilonD"/> /// The tolerance value used is <see cref="MathFunctions.Epsilon"/>
/// </remarks> /// </remarks>
public void ClampZero() public void ClampZero()
{ {
@@ -895,10 +895,10 @@ namespace Framework.GameMath
return array; return array;
} }
/// <summary> /// <summary>
/// Converts the vector to a <see cref="System.Collections.Generic.List"/> of single-precision floating point values. /// Converts the vector to a <see cref="System.Collections.Generic.List{T}"/> of single-precision floating point values.
/// </summary> /// </summary>
/// <param name="vector">A <see cref="Vector3"/> instance.</param> /// <param name="vector">A <see cref="Vector3"/> instance.</param>
/// <returns>A <see cref="System.Collections.Generic.List"/> of single-precision floating point values.</returns> /// <returns>A <see cref="System.Collections.Generic.List{T}"/> of single-precision floating point values.</returns>
public static explicit operator List<float>(Vector3 vector) public static explicit operator List<float>(Vector3 vector)
{ {
List<float> list = new List<float>(3); List<float> list = new List<float>(3);
@@ -909,10 +909,10 @@ namespace Framework.GameMath
return list; return list;
} }
/// <summary> /// <summary>
/// Converts the vector to a <see cref="System.Collections.Generic.LinkedList"/> of single-precision floating point values. /// Converts the vector to a <see cref="System.Collections.Generic.LinkedList{T}"/> of single-precision floating point values.
/// </summary> /// </summary>
/// <param name="vector">A <see cref="Vector3"/> instance.</param> /// <param name="vector">A <see cref="Vector3"/> instance.</param>
/// <returns>A <see cref="System.Collections.Generic.LinkedList"/> of single-precision floating point values.</returns> /// <returns>A <see cref="System.Collections.Generic.LinkedList{T}"/> of single-precision floating point values.</returns>
public static explicit operator LinkedList<float>(Vector3 vector) public static explicit operator LinkedList<float>(Vector3 vector)
{ {
LinkedList<float> list = new LinkedList<float>(); LinkedList<float> list = new LinkedList<float>();
@@ -1061,7 +1061,6 @@ namespace Framework.GameMath
/// <param name="culture">The <see cref="System.Globalization.CultureInfo"/> to use as the current culture. </param> /// <param name="culture">The <see cref="System.Globalization.CultureInfo"/> to use as the current culture. </param>
/// <param name="value">The <see cref="Object"/> to convert.</param> /// <param name="value">The <see cref="Object"/> to convert.</param>
/// <returns>An <see cref="Object"/> that represents the converted value.</returns> /// <returns>An <see cref="Object"/> that represents the converted value.</returns>
/// <exception cref="ParseException">Failed parsing from string.</exception>
public override object ConvertFrom(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value) public override object ConvertFrom(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value)
{ {
if (value.GetType() == typeof(string)) if (value.GetType() == typeof(string))
+5 -6
View File
@@ -576,7 +576,7 @@ namespace Framework.GameMath
/// </summary> /// </summary>
/// <remarks> /// <remarks>
/// The vector values that are close to zero within the given tolerance are set to zero. /// The vector values that are close to zero within the given tolerance are set to zero.
/// The tolerance value used is <see cref="MathFunctions.EpsilonD"/> /// The tolerance value used is <see cref="MathFunctions.Epsilon"/>
/// </remarks> /// </remarks>
public void ClampZero() public void ClampZero()
{ {
@@ -908,10 +908,10 @@ namespace Framework.GameMath
return array; return array;
} }
/// <summary> /// <summary>
/// Converts the vector to a <see cref="System.Collections.Generic.List"/> of single-precision floating point values. /// Converts the vector to a <see cref="System.Collections.Generic.List{T}"/> of single-precision floating point values.
/// </summary> /// </summary>
/// <param name="vector">A <see cref="Vector4"/> instance.</param> /// <param name="vector">A <see cref="Vector4"/> instance.</param>
/// <returns>A <see cref="System.Collections.Generic.List"/> of single-precision floating point values.</returns> /// <returns>A <see cref="System.Collections.Generic.List{T}"/> of single-precision floating point values.</returns>
public static explicit operator List<float>(Vector4 vector) public static explicit operator List<float>(Vector4 vector)
{ {
List<float> list = new List<float>(4); List<float> list = new List<float>(4);
@@ -923,10 +923,10 @@ namespace Framework.GameMath
return list; return list;
} }
/// <summary> /// <summary>
/// Converts the vector to a <see cref="System.Collections.Generic.LinkedList"/> of single-precision floating point values. /// Converts the vector to a <see cref="System.Collections.Generic.LinkedList{T}"/> of single-precision floating point values.
/// </summary> /// </summary>
/// <param name="vector">A <see cref="Vector4"/> instance.</param> /// <param name="vector">A <see cref="Vector4"/> instance.</param>
/// <returns>A <see cref="System.Collections.Generic.LinkedList"/> of single-precision floating point values.</returns> /// <returns>A <see cref="System.Collections.Generic.LinkedList{T}"/> of single-precision floating point values.</returns>
public static explicit operator LinkedList<float>(Vector4 vector) public static explicit operator LinkedList<float>(Vector4 vector)
{ {
LinkedList<float> list = new LinkedList<float>(); LinkedList<float> list = new LinkedList<float>();
@@ -997,7 +997,6 @@ namespace Framework.GameMath
/// <param name="culture">The <see cref="System.Globalization.CultureInfo"/> to use as the current culture. </param> /// <param name="culture">The <see cref="System.Globalization.CultureInfo"/> to use as the current culture. </param>
/// <param name="value">The <see cref="Object"/> to convert.</param> /// <param name="value">The <see cref="Object"/> to convert.</param>
/// <returns>An <see cref="Object"/> that represents the converted value.</returns> /// <returns>An <see cref="Object"/> that represents the converted value.</returns>
/// <exception cref="ParseException">Failed parsing from string.</exception>
public override object ConvertFrom(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value) public override object ConvertFrom(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value)
{ {
if (value.GetType() == typeof(string)) if (value.GetType() == typeof(string))
@@ -247,8 +247,8 @@ public static partial class Detour
/// @param[in] pt The point to check. [(x, y, z)] /// @param[in] pt The point to check. [(x, y, z)]
/// @param[in] verts The polygon vertices. [(x, y, z) * @p nverts] /// @param[in] verts The polygon vertices. [(x, y, z) * @p nverts]
/// @param[in] nverts The number of vertices. [Limit: >= 3] /// @param[in] nverts The number of vertices. [Limit: >= 3]
/// @return True if the point is inside the polygon. // @return True if the point is inside the polygon.
/// @par // @par
/// ///
/// All points are projected onto the xz-plane, so the y-values are ignored. /// All points are projected onto the xz-plane, so the y-values are ignored.
public static bool dtPointInPolygon(float[] pt, float[] verts, int nverts) 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] npolya The number of vertices in polygon A.
/// @param[in] polyb Polygon B vertices. [(x, y, z) * @p npolyb] /// @param[in] polyb Polygon B vertices. [(x, y, z) * @p npolyb]
/// @param[in] npolyb The number of vertices in polygon B. /// @param[in] npolyb The number of vertices in polygon B.
/// @return True if the two polygons overlap. // @return True if the two polygons overlap.
/// @par // @par
/// ///
/// All vertices are projected onto the xz-plane, so the y-values are ignored. /// 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) 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); 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) /// Derives the cross product of two vectors. (@p v1 x @p v2)
/// @param[out] dest The cross product. [(x, y, z)] /// @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) /// Derives the dot product of two vectors. (@p v1 . @p v2)
/// @param[in] v1 A Vector [(x, y, z)] /// @param[in] v1 A Vector [(x, y, z)]
/// @param[in] v2 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) public static float dtVdot(float[] v1, float[] v2)
{ {
return v1[0] * v2[0] + v1[1] * v2[1] + v1[2] * v2[2]; 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[out] dest The result vector. [(x, y, x)]
/// @param[in] v1 The starting vector. /// @param[in] v1 The starting vector.
/// @param[in] v2 The destination 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 &lt;= value &lt;= 1.0]
public static void dtVlerp(float[] dest, float[] v1, float[] v2, float t) public static void dtVlerp(float[] dest, float[] v1, float[] v2, float t)
{ {
dest[0] = v1[0] + (v2[0] - v1[0]) * 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. /// Derives the scalar length of the vector.
/// @param[in] v The vector. [(x, y, z)] /// @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) public static float dtVlen(float[] v)
{ {
return (float)Math.Sqrt(v[0] * v[0] + v[1] * v[1] + v[2] * v[2]); 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) /// Derives the square of the scalar length of the vector. (len * len)
/// @param[in] v The vector. [(x, y, z)] /// @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) public static float dtVlenSqr(float[] v)
{ {
return v[0] * v[0] + v[1] * v[1] + v[2] * v[2]; 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. /// Returns the distance between two points.
/// @param[in] v1 A point. [(x, y, z)] /// @param[in] v1 A point. [(x, y, z)]
/// @param[in] v2 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) public static float dtVdist(float[] v1, float[] v2)
{ {
float dx = v2[0] - v1[0]; float dx = v2[0] - v1[0];
@@ -691,7 +691,7 @@ public static partial class Detour
/// Returns the square of the distance between two points. /// Returns the square of the distance between two points.
/// @param[in] v1 A point. [(x, y, z)] /// @param[in] v1 A point. [(x, y, z)]
/// @param[in] v2 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) public static float dtVdistSqr(float[] v1, float[] v2)
{ {
float dx = v2[0] - v1[0]; 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. /// Derives the distance between the specified points on the xz-plane.
/// @param[in] v1 A point. [(x, y, z)] /// @param[in] v1 A point. [(x, y, z)]
/// @param[in] v2 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. /// The vectors are projected onto the xz-plane, so the y-values are ignored.
public static float dtVdist2D(float[] v1, float[] v2) 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. /// Derives the square of the distance between the specified points on the xz-plane.
/// @param[in] v1 A point. [(x, y, z)] /// @param[in] v1 A point. [(x, y, z)]
/// @param[in] v2 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) public static float dtVdist2DSqr(float[] v1, float[] v2)
{ {
float dx = v2[0] - v1[0]; float dx = v2[0] - v1[0];
@@ -761,7 +761,7 @@ public static partial class Detour
/// Performs a 'sloppy' colocation check of the specified points. /// Performs a 'sloppy' colocation check of the specified points.
/// @param[in] p0 A point. [(x, y, z)] /// @param[in] p0 A point. [(x, y, z)]
/// @param[in] p1 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 /// Basically, this function will return true if the specified points are
/// close enough to eachother to be considered colocated. /// 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) /// 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] u A vector [(x, y, z)]
/// @param[in] v 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. /// The vectors are projected onto the xz-plane, so the y-values are ignored.
public static float dtVdot2D(float[] u, float[] v) 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) /// 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] u The LHV vector [(x, y, z)]
/// @param[in] v The RHV 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. /// The vectors are projected onto the xz-plane, so the y-values are ignored.
public static float dtVperp2D(float[] u, float[] v) 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]; 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] a Vertex A. [(x, y, z)]
/// @param[in] b Vertex B. [(x, y, z)] /// @param[in] b Vertex B. [(x, y, z)]
/// @param[in] c Vertex C. [(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) public static float dtTriArea2D(float[] a, float[] b, float[] c)
{ {
float abx = b[0] - a[0]; 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] amax Maximum bounds of box A. [(x, y, z)]
/// @param[in] bmin Minimum bounds of box B. [(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)] /// @param[in] bmax Maximum bounds of box B. [(x, y, z)]
/// @return True if the two AABB's overlap. // @return True if the two AABB's overlap.
/// @see dtOverlapBounds // @see dtOverlapBounds
public static bool dtOverlapQuantBounds(ushort[] amin, ushort[] amax, ushort[] bmin, ushort[] bmax) public static bool dtOverlapQuantBounds(ushort[] amin, ushort[] amax, ushort[] bmin, ushort[] bmax)
{ {
bool overlap = true; 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] amax Maximum bounds of box A. [(x, y, z)]
/// @param[in] bmin Minimum bounds of box B. [(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)] /// @param[in] bmax Maximum bounds of box B. [(x, y, z)]
/// @return True if the two AABB's overlap. // @return True if the two AABB's overlap.
/// @see dtOverlapQuantBounds // @see dtOverlapQuantBounds
public static bool dtOverlapBounds(float[] amin, float[] amax, float[] bmin, float[] bmax) public static bool dtOverlapBounds(float[] amin, float[] amax, float[] bmin, float[] bmax)
{ {
bool overlap = true; bool overlap = true;
@@ -905,9 +905,9 @@ public static partial class Detour
return overlap; return overlap;
} }
/// @} // @}
/// @name Miscellanious functions. // @name Miscellanious functions.
/// @{ // @{
public static uint dtNextPow2(uint v) public static uint dtNextPow2(uint v)
{ {
@@ -164,7 +164,7 @@ public static partial class Detour
return new(mem) dtNavMesh; return new(mem) dtNavMesh;
} }
*/ */
/// @par // @par
/// ///
/// This function will only free the memory for tiles with the #DT_TILE_FREE_DATA /// This function will only free the memory for tiles with the #DT_TILE_FREE_DATA
/// flag set. /// flag set.
@@ -208,7 +208,7 @@ public static partial class Detour
@see dtNavMeshQuery, dtCreateNavMeshData, dtNavMeshCreateParams, #dtAllocNavMesh, #dtFreeNavMesh @see dtNavMeshQuery, dtCreateNavMeshData, dtNavMeshCreateParams, #dtAllocNavMesh, #dtFreeNavMesh
*/ */
/// A navigation mesh based on tiles of convex polygons. /// A navigation mesh based on tiles of convex polygons.
/// @ingroup detour // @ingroup detour
public class dtNavMesh public class dtNavMesh
{ {
private dtNavMeshParams m_params; //< Current initialization params. TODO: do not store this info twice. 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); return (uint)(polyRef & polyMask);
} }
/// @{ // @{
/// @name Initialization and Tile Management // @name Initialization and Tile Management
/// Initializes the navigation mesh for tiled use. /// Initializes the navigation mesh for tiled use.
/// @param[in] params Initialization parameters. /// @param[in] params Initialization parameters.
/// @return The status flags for the operation. // @return The status flags for the operation.
public dtStatus init(dtNavMeshParams navMeshParams) public dtStatus init(dtNavMeshParams navMeshParams)
{ {
//memcpy(&m_params, params, sizeof(dtNavMeshParams)); //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] data Data of the new tile. (See: #dtCreateNavMeshData)
/// @param[in] dataSize The data size of the new tile. /// @param[in] dataSize The data size of the new tile.
/// @param[in] flags The tile flags. (See: #dtTileFlags) /// @param[in] flags The tile flags. (See: #dtTileFlags)
/// @return The status flags for the operation. // @return The status flags for the operation.
/// @see dtCreateNavMeshData /// @see dtCreateNavMeshData
public dtStatus init(dtRawTileData rawTile, int flags) public dtStatus init(dtRawTileData rawTile, int flags)
{ {
@@ -394,9 +394,9 @@ public static partial class Detour
} }
/// The navigation mesh initialization params. /// 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. /// initialization is performed.
public dtNavMeshParams getParams() 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 /// 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. /// 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 /// tile will be restored to the same values they were before the tile was
/// removed. /// removed.
/// ///
/// @see dtCreateNavMeshData, #removeTile // @see dtCreateNavMeshData, #removeTile
/// Adds a tile to the navigation mesh. /// Adds a tile to the navigation mesh.
/// @param[in] data Data for the new tile mesh. (See: #dtCreateNavMeshData) /// @param[in] data Data for the new tile mesh. (See: #dtCreateNavMeshData)
/// @param[in] dataSize Data size of the new tile mesh. /// @param[in] dataSize Data size of the new tile mesh.
/// @param[in] flags Tile flags. (See: #dtTileFlags) /// @param[in] flags Tile flags. (See: #dtTileFlags)
/// @param[in] lastRef The desired reference for the tile. (When reloading a tile.) [opt] [Default: 0] /// @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] /// @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) public dtStatus addTile(dtRawTileData rawTileData, int flags, dtTileRef lastRef, ref dtTileRef result)
{ {
//C#: Using an intermediate class dtRawTileData because Cpp uses a binary buffer. //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] x The tile's x-location. (x, y, layer)
/// @param[in] y The tile's y-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) /// @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) public dtMeshTile getTileAt(int x, int y, int layer)
{ {
// Find tile based on hash. // 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 /// 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. /// 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[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[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. /// @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) public int getTilesAt(int x, int y, dtMeshTile[] tiles, int maxTiles)
{ {
int n = 0; 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] x The tile's x-location. (x, y, layer)
/// @param[in] y The tile's y-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) /// @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) public dtTileRef getTileRefAt(int x, int y, int layer)
{ {
// Find tile based on hash. // Find tile based on hash.
@@ -1249,7 +1249,7 @@ public static partial class Detour
} }
/// Gets the tile for the specified tile reference. /// Gets the tile for the specified tile reference.
/// @param[in] ref The tile reference of the tile to retrieve. /// @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. /// reference is invalid.
public dtMeshTile getTileByRef(dtTileRef tileRef) public dtMeshTile getTileByRef(dtTileRef tileRef)
{ {
@@ -1266,15 +1266,15 @@ public static partial class Detour
} }
/// The maximum number of tiles supported by the navigation mesh. /// 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() public int getMaxTiles()
{ {
return m_maxTiles; return m_maxTiles;
} }
/// Gets the tile at the specified index. /// Gets the tile at the specified index.
/// @param[in] i The tile index. [Limit: 0 >= index < #getMaxTiles()] /// @param[in] i The tile index. [Limit: 0 >= index &lt; #getMaxTiles()]
/// @return The tile at the specified index. // @return The tile at the specified index.
public dtMeshTile getTile(int i) public dtMeshTile getTile(int i)
{ {
return m_tiles[i]; return m_tiles[i];
@@ -1294,7 +1294,7 @@ public static partial class Detour
/// @param[in] ref The reference for the a polygon. /// @param[in] ref The reference for the a polygon.
/// @param[out] tile The tile containing the polygon. /// @param[out] tile The tile containing the polygon.
/// @param[out] poly 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) public dtStatus getTileAndPolyByRef(dtPolyRef polyRef, ref dtMeshTile tile, ref dtPoly poly)
{ {
if (polyRef == 0) if (polyRef == 0)
@@ -1331,9 +1331,9 @@ public static partial class Detour
return DT_SUCCESS; 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 /// reference is valid. This function is faster than #getTileAndPolyByRef, but
/// it does not validate the reference. /// it does not validate the reference.
/// Returns the tile and polygon for the specified polygon 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. /// Checks the validity of a polygon reference.
/// @param[in] ref The polygon reference to check. /// @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) public bool isValidPolyRef(dtPolyRef polyRef)
{ {
if (polyRef == 0) if (polyRef == 0)
@@ -1374,17 +1374,17 @@ public static partial class Detour
return true; return true;
} }
/// @par // @par
/// ///
/// This function returns the data for the tile so that, if desired, /// 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. /// 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. /// Removes the specified tile from the navigation mesh.
/// @param[in] ref The reference of the tile to remove. /// @param[in] ref The reference of the tile to remove.
/// @param[out] data Data associated with deleted tile. /// @param[out] data Data associated with deleted tile.
/// @param[out] dataSize Size of the 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) public dtStatus removeTile(dtTileRef tileRef, out dtRawTileData rawTileData)
{ {
rawTileData = null; rawTileData = null;
@@ -1488,7 +1488,7 @@ public static partial class Detour
/// Gets the tile reference for the specified tile. /// Gets the tile reference for the specified tile.
/// @param[in] tile The 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) public dtTileRef getTileRef(dtMeshTile tile)
{ {
if (tile == null) return 0; if (tile == null) return 0;
@@ -1496,23 +1496,23 @@ public static partial class Detour
return encodePolyId(tile.salt, it, 0); return encodePolyId(tile.salt, it, 0);
} }
/// @par // @par
/// ///
/// Example use case: /// Example use case:
/// @code // @code
/// ///
/// const dtPolyRef base = navmesh.getPolyRefBase(tile); /// const dtPolyRef base = navmesh.getPolyRefBase(tile);
/// for (int i = 0; i < tile.header.polyCount; ++i) /// for (int i = 0; i &lt; tile.header.polyCount; ++i)
/// { /// {
/// const dtPoly* p = &tile.polys[i]; /// const dtPoly* p = tile.polys[i];
/// const dtPolyRef ref = base | (dtPolyRef)i; /// const dtPolyRef ref = base | (dtPolyRef)i;
/// ///
/// // Use the reference to access the polygon data. /// // Use the reference to access the polygon data.
/// } /// }
/// @endcode // @endcode
/// Gets the polygon reference for the tile's base polygon. /// Gets the polygon reference for the tile's base polygon.
/// @param[in] tile The tile. /// @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) public dtPolyRef getPolyRefBase(dtMeshTile tile)
{ {
if (tile == null) return 0; if (tile == null) return 0;
@@ -1525,7 +1525,7 @@ public static partial class Detour
/// @see #storeTileState /// @see #storeTileState
/// Gets the size of the buffer required by #storeTileState to store the specified tile's state. /// Gets the size of the buffer required by #storeTileState to store the specified tile's state.
/// @param[in] tile The tile. /// @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) int getTileStateSize(dtMeshTile tile)
{ {
if (tile == null) return 0; if (tile == null) return 0;
@@ -1534,16 +1534,16 @@ public static partial class Detour
return headerSize + polyStateSize; return headerSize + polyStateSize;
} }
/// @par // @par
/// ///
/// Tile state includes non-structural data such as polygon flags, area ids, etc. /// 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. // @note The state data is only valid until the tile reference changes.
/// @see #getTileStateSize, #restoreTileState // @see #getTileStateSize, #restoreTileState
/// Stores the non-structural state of the tile in the specified buffer. (Flags, area ids, etc.) /// Stores the non-structural state of the tile in the specified buffer. (Flags, area ids, etc.)
/// @param[in] tile The tile. /// @param[in] tile The tile.
/// @param[out] data The buffer to store the tile's state in. /// @param[out] data The buffer to store the tile's state in.
/// @param[in] maxDataSize The size of the data buffer. [Limit: >= #getTileStateSize] /// @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 dtStatus dtNavMesh::storeTileState(const dtMeshTile* tile, byte* data, const int maxDataSize) const
{ {
// Make sure there is enough space to store the state. // Make sure there is enough space to store the state.
@@ -1571,16 +1571,16 @@ public static partial class Detour
return DT_SUCCESS; return DT_SUCCESS;
} }
/// @par // @par
/// ///
/// Tile state includes non-structural data such as polygon flags, area ids, etc. /// 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. // @note This function does not impact the tile's #dtTileRef and #dtPolyRef's.
/// @see #storeTileState // @see #storeTileState
/// Restores the state of the tile. /// Restores the state of the tile.
/// @param[in] tile The tile. /// @param[in] tile The tile.
/// @param[in] data The new state. (Obtained from #storeTileState.) /// @param[in] data The new state. (Obtained from #storeTileState.)
/// @param[in] maxDataSize The size of the state within the data buffer. /// @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) dtStatus dtNavMesh::restoreTileState(dtMeshTile* tile, const byte* data, const int maxDataSize)
{ {
// Make sure there is enough space to store the state. // Make sure there is enough space to store the state.
@@ -1611,7 +1611,7 @@ public static partial class Detour
return DT_SUCCESS; return DT_SUCCESS;
} }
*/ */
/// @par // @par
/// ///
/// Off-mesh connections are stored in the navigation mesh as special 2-vertex /// 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 /// 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[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] 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)] /// @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) public dtStatus getOffMeshConnectionPolyEndPoints(dtPolyRef prevRef, dtPolyRef polyRef, float[] startPos, float[] endPos)
{ {
uint salt = 0, it = 0, ip = 0; uint salt = 0, it = 0, ip = 0;
@@ -1668,7 +1668,7 @@ public static partial class Detour
/// Gets the specified off-mesh connection. /// Gets the specified off-mesh connection.
/// @param[in] ref The polygon reference of the 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) public dtOffMeshConnection getOffMeshConnectionByRef(dtPolyRef polyRef)
{ {
uint salt = 0, it = 0, ip = 0; uint salt = 0, it = 0, ip = 0;
@@ -1693,14 +1693,14 @@ public static partial class Detour
return tile.offMeshCons[idx]; return tile.offMeshCons[idx];
} }
/// @{ // @{
/// @name State Management // @name State Management
/// These functions do not effect #dtTileRef or #dtPolyRef's. /// These functions do not effect #dtTileRef or #dtPolyRef's.
/// Sets the user defined flags for the specified polygon. /// Sets the user defined flags for the specified polygon.
/// @param[in] ref The polygon reference. /// @param[in] ref The polygon reference.
/// @param[in] flags The new flags for the polygon. /// @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) public dtStatus setPolyFlags(dtPolyRef polyRef, ushort flags)
{ {
if (polyRef == 0) return DT_FAILURE; if (polyRef == 0) return DT_FAILURE;
@@ -1723,7 +1723,7 @@ public static partial class Detour
/// Gets the user defined flags for the specified polygon. /// Gets the user defined flags for the specified polygon.
/// @param[in] ref The polygon reference. /// @param[in] ref The polygon reference.
/// @param[out] resultFlags The polygon flags. /// @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) public dtStatus getPolyFlags(dtPolyRef polyRef, ref ushort resultFlags)
{ {
if (polyRef == 0) return DT_FAILURE; if (polyRef == 0) return DT_FAILURE;
@@ -1742,8 +1742,8 @@ public static partial class Detour
/// Sets the user defined area for the specified polygon. /// Sets the user defined area for the specified polygon.
/// @param[in] ref The polygon reference. /// @param[in] ref The polygon reference.
/// @param[in] area The new area id for the polygon. [Limit: < #DT_MAX_AREAS] /// @param[in] area The new area id for the polygon. [Limit: &lt; #DT_MAX_AREAS]
/// @return The status flags for the operation. // @return The status flags for the operation.
public dtStatus setPolyArea(dtPolyRef polyRef, byte area) public dtStatus setPolyArea(dtPolyRef polyRef, byte area)
{ {
if (polyRef == 0) return DT_FAILURE; if (polyRef == 0) return DT_FAILURE;
@@ -1763,7 +1763,7 @@ public static partial class Detour
/// Gets the user defined area for the specified polygon. /// Gets the user defined area for the specified polygon.
/// @param[in] ref The polygon reference. /// @param[in] ref The polygon reference.
/// @param[out] resultArea The area id for the polygon. /// @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) public dtStatus getPolyArea(dtPolyRef polyRef, ref byte resultArea)
{ {
if (polyRef == 0) return DT_FAILURE; if (polyRef == 0) return DT_FAILURE;
@@ -6,11 +6,11 @@ using dtPolyRef = System.UInt64;
public static partial class Detour public static partial class Detour
{ {
/// The maximum number of vertices per navigation polygon. /// The maximum number of vertices per navigation polygon.
/// @ingroup detour // @ingroup detour
public const int DT_VERTS_PER_POLYGON = 6; 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 /// These constants are used to detect whether a navigation tile's data
/// and state format is compatible with the current build. /// 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. /// A version number used to detect compatibility of navigation tile states.
public const int DT_NAVMESH_STATE_VERSION = 1; public const int DT_NAVMESH_STATE_VERSION = 1;
/// @} // @}
/// A flag that indicates that an entity links to an external entity. /// 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.) /// (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; public const uint DT_OFFMESH_CON_BIDIR = 1;
/// The maximum number of user defined area ids. /// The maximum number of user defined area ids.
/// @ingroup detour // @ingroup detour
public const int DT_MAX_AREAS = 64; public const int DT_MAX_AREAS = 64;
const ushort MESH_NULL_IDX = 0xffff; const ushort MESH_NULL_IDX = 0xffff;
@@ -79,7 +79,7 @@ public static partial class Detour
/// Defines a polyogn within a dtMeshTile object. /// Defines a polyogn within a dtMeshTile object.
/// @ingroup detour // @ingroup detour
public class dtPoly public class dtPoly
{ {
/// Index to first link in linked list. (Or #DT_NULL_LINK if there is no link.) /// 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; public byte vertCount;
/// The bit packed area id and polygon type. /// 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 byte areaAndtype;
public int FromBytes(byte[] array, int start) public int FromBytes(byte[] array, int start)
@@ -158,7 +158,7 @@ public static partial class Detour
return bytes.ToArray(); return bytes.ToArray();
} }
/// Sets the user defined area id. [Limit: < #DT_MAX_AREAS] /// Sets the user defined area id. [Limit: &lt; #DT_MAX_AREAS]
public void setArea(byte a) public void setArea(byte a)
{ {
//Bitwise operators are done on ints in C# //Bitwise operators are done on ints in C#
@@ -216,8 +216,8 @@ public static partial class Detour
}; };
/// Defines a link between polygons. /// Defines a link between polygons.
/// @note This structure is rarely if ever used by the end user. // @note This structure is rarely if ever used by the end user.
/// @see dtMeshTile // @see dtMeshTile
public class dtLink public class dtLink
{ {
public dtPolyRef polyRef; //< Neighbour reference. (The neighbor that is linked to.) public dtPolyRef polyRef; //< Neighbour reference. (The neighbor that is linked to.)
@@ -254,8 +254,8 @@ public static partial class Detour
}; };
/// Bounding volume node. /// Bounding volume node.
/// @note This structure is rarely if ever used by the end user. // @note This structure is rarely if ever used by the end user.
/// @see dtMeshTile // @see dtMeshTile
public class dtBVNode public class dtBVNode
{ {
public ushort[] bmin = new ushort[3]; //< Minimum bounds of the node's AABB. [(x, y, z)] 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; public ushort poly;
/// Link flags. /// 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. /// connection's dtPoly definition. These are link flags used for internal purposes.
public byte flags; public byte flags;
@@ -352,7 +352,7 @@ public static partial class Detour
/// Provides high level information related to a dtMeshTile object. /// Provides high level information related to a dtMeshTile object.
/// @ingroup detour // @ingroup detour
public class dtMeshHeader public class dtMeshHeader
{ {
public int magic; //< Tile magic number. (Used to identify the data format.) 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. /// Defines a navigation mesh tile.
/// @ingroup detour // @ingroup detour
/* /*
@struct dtMeshTile @struct dtMeshTile
@par @par
@@ -661,8 +661,8 @@ public static partial class Detour
/// Configuration parameters used to define multi-tile navigation meshes. /// Configuration parameters used to define multi-tile navigation meshes.
/// The values are used to allocate space during the initialization of a navigation mesh. /// The values are used to allocate space during the initialization of a navigation mesh.
/// @see dtNavMesh::init() // @see dtNavMesh::init()
/// @ingroup detour // @ingroup detour
public class dtNavMeshParams public class dtNavMeshParams
{ {
public float[] orig = new float[3]; //< The world space origin of the navigation mesh's tile space. [(x, y, z)] 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. /// Represents the source data used to build an navigation mesh tile.
/// @ingroup detour // @ingroup detour
/** /**
@struct dtNavMeshCreateParams @struct dtNavMeshCreateParams
@par @par
@@ -709,10 +709,10 @@ public static partial class Detour
public class dtNavMeshCreateParams public class dtNavMeshCreateParams
{ {
/// @name Polygon Mesh Attributes // @name Polygon Mesh Attributes
/// Used to create the base navigation graph. // Used to create the base navigation graph.
/// See #rcPolyMesh for details related to these attributes. // See #rcPolyMesh for details related to these attributes.
/// @{ // @{
public ushort[] verts; //< The polygon mesh vertices. [(x, y, z) * #vertCount] [Unit: vx] 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] 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 polyCount; //< Number of polygons in the mesh. [Limit: >= 1]
public int nvp; //< Number maximum number of vertices per polygon. [Limit: >= 3] public int nvp; //< Number maximum number of vertices per polygon. [Limit: >= 3]
/// @} // @}
/// @name Height Detail Attributes (Optional) // @name Height Detail Attributes (Optional)
/// See #rcPolyMeshDetail for details related to these attributes. // See #rcPolyMeshDetail for details related to these attributes.
/// @{ // @{
public uint[] detailMeshes; //< The height detail sub-mesh data. [Size: 4 * #polyCount] public uint[] detailMeshes; //< The height detail sub-mesh data. [Size: 4 * #polyCount]
public float[] detailVerts; //< The detail mesh vertices. [Size: 3 * #detailVertsCount] [Unit: wu] 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 byte[] detailTris; //< The detail mesh triangles. [Size: 4 * #detailTriCount]
public int detailTriCount; //< The number of triangles in the detail mesh. public int detailTriCount; //< The number of triangles in the detail mesh.
/// @} // @}
/// @name Off-Mesh Connections Attributes (Optional) // @name Off-Mesh Connections Attributes (Optional)
/// Used to define a custom point-to-point edge within the navigation graph, an // 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, // 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. // 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; public float[] offMeshConVerts;
/// Off-mesh connection radii. [Size: #offMeshConCount] [Unit: wu] // Off-mesh connection radii. [Size: #offMeshConCount] [Unit: wu]
public float[] offMeshConRad; 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; 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; public byte[] offMeshConAreas;
/// The permitted travel direction of the off-mesh connections. [Size: #offMeshConCount] // The permitted travel direction of the off-mesh connections. [Size: #offMeshConCount]
/// //
/// 0 = Travel only from endpoint A to endpoint B.<br/> // 0 = Travel only from endpoint A to endpoint B.<br/>
/// #DT_OFFMESH_CON_BIDIR = Bidirectional travel. // #DT_OFFMESH_CON_BIDIR = Bidirectional travel.
public byte[] offMeshConDir; 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; public uint[] offMeshConUserID;
/// The number of off-mesh connections. [Limit: >= 0] // The number of off-mesh connections. [Limit: >= 0]
public int offMeshConCount; public int offMeshConCount;
/// @} // @}
/// @name Tile Attributes // @name Tile Attributes
/// @note The tile grid/layer data can be left at zero if the destination is a single tile mesh. // @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 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.) 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[] 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] 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 walkableHeight; //< The agent height. [Unit: wu]
public float walkableRadius; //< The agent radius. [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] 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. /// 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 bool buildBvTree;
/// @} // @}
} }
public class BVItem public class BVItem
@@ -1008,19 +1008,19 @@ public static partial class Detour
// TODO: Better error handling. // TODO: Better error handling.
/// @par // @par
/// ///
/// The output data array is allocated using the detour allocator (dtAlloc()). The method /// 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 /// used to free the memory will be determined by how the tile is added to the navigation
/// mesh. /// mesh.
/// ///
/// @see dtNavMesh, dtNavMesh::addTile() // @see dtNavMesh, dtNavMesh::addTile()
/// Builds navigation mesh tile data from the provided tile creation data. /// Builds navigation mesh tile data from the provided tile creation data.
/// @ingroup detour // @ingroup detour
/// @param[in] params Tile creation data. /// @param[in] params Tile creation data.
/// @param[out] outData The resulting tile data. /// @param[out] outData The resulting tile data.
/// @param[out] outDataSize The size of the tile data array. /// @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) public static bool dtCreateNavMeshData(dtNavMeshCreateParams createParams, out dtRawTileData outTile)//ref byte[] outData, ref int outDataSize)
{ {
outTile = null; outTile = null;
@@ -1526,15 +1526,15 @@ public static partial class Detour
return true; return true;
} }
*/ */
/// @par // @par
/// //
/// @warning This function assumes that the header is in the correct endianess already. // @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 // 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 // to start with. Call #dtNavMeshHeaderSwapEndian() after the data has been swapped if converting from
/// native to foreign endianess. // native to foreign endianess.
/// Swaps endianess of the tile data. // Swaps endianess of the tile data.
/// @param[in,out] data The tile data array. // @param[in,out] data The tile data array.
/// @param[in] dataSize The size of the data array. // @param[in] dataSize The size of the data array.
/* /*
bool dtNavMeshDataSwapEndian(byte* data, const int dataSize) bool dtNavMeshDataSwapEndian(byte* data, const int dataSize)
{ {
@@ -1,36 +1,36 @@
/// @class dtQueryFilter // @class dtQueryFilter
/// //
/// <b>The Default Implementation</b> // <b>The Default Implementation</b>
/// //
/// At construction: All area costs default to 1.0. All flags are included // At construction: All area costs default to 1.0. All flags are included
/// and none are excluded. // and none are excluded.
/// //
/// If a polygon has both an include and an exclude flag, it will be 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 // 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 // set to ever be considered by a query. So a polygon with no flags will never
/// be considered. // be considered.
/// //
/// Setting the include flags to 0 will result in all polygons being excluded. // Setting the include flags to 0 will result in all polygons being excluded.
/// //
/// <b>Custom Implementations</b> // <b>Custom Implementations</b>
/// //
/// DT_VIRTUAL_QUERYFILTER must be defined in order to extend this class. // DT_VIRTUAL_QUERYFILTER must be defined in order to extend this class.
/// //
/// Implement a custom query filter by overriding the virtual passFilter() // Implement a custom query filter by overriding the virtual passFilter()
/// and getCost() functions. If this is done, both functions should be as // and getCost() functions. If this is done, both functions should be as
/// fast as possible. Use cached local copies of data rather than accessing // fast as possible. Use cached local copies of data rather than accessing
/// your own objects where possible. // your own objects where possible.
/// //
/// Custom implementations do not need to adhere to the flags or cost logic // Custom implementations do not need to adhere to the flags or cost logic
/// used by the default implementation. // used by the default implementation.
/// //
/// In order for A* searches to work properly, the cost should be proportional to // 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 // the travel distance. Implementing a cost modifier less than 1.0 is likely
/// to lead to problems during pathfinding. // to lead to problems during pathfinding.
/// //
/// @see dtNavMeshQuery // @see dtNavMeshQuery
/// //
using System; using System;
using System.Diagnostics; using System.Diagnostics;
@@ -49,7 +49,7 @@ public static partial class Detour
const float H_SCALE = 0.999f; // Search heuristic scale. const float H_SCALE = 0.999f; // Search heuristic scale.
/// Defines polygon filtering and traversal costs for navigation mesh query operations. /// Defines polygon filtering and traversal costs for navigation mesh query operations.
/// @ingroup detour // @ingroup detour
public class dtQueryFilter public class dtQueryFilter
{ {
public float[] m_areaCost = new float[DT_MAX_AREAS]; //< Cost per area type. (Used by default implementation.) 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()]; 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. /// Returns the traversal cost of the area.
/// @param[in] i The id 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) public float getAreaCost(int i)
{ {
return m_areaCost[i]; return m_areaCost[i];
@@ -119,7 +119,7 @@ public static partial class Detour
} }
/// Sets the include flags for the filter. /// Sets the include flags for the filter.
/// @param[in] flags The new flags. // @param[in] flags The new flags.
public void setIncludeFlags(ushort flags) public void setIncludeFlags(ushort flags)
{ {
m_includeFlags = flags; m_includeFlags = flags;
@@ -134,7 +134,7 @@ public static partial class Detour
} }
/// Sets the exclude flags for the filter. /// Sets the exclude flags for the filter.
/// @param[in] flags The new flags. // @param[in] flags The new flags.
public void setExcludeFlags(ushort flags) public void setExcludeFlags(ushort flags)
{ {
m_excludeFlags = 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 /// Provides the ability to perform pathfinding related queries against
/// a navigation mesh. /// a navigation mesh.
/// ///
@@ -159,8 +159,8 @@ public static partial class Detour
/// considered impassable. A @e portal is a passable segment between polygons. /// 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. /// A portal may be treated as a wall based on the dtQueryFilter used for a query.
/// ///
/// @see dtNavMesh, dtQueryFilter, #dtAllocNavMeshQuery(), #dtAllocNavMeshQuery() // @see dtNavMesh, dtQueryFilter, #dtAllocNavMeshQuery(), #dtAllocNavMeshQuery()
/// @ingroup detour // @ingroup detour
public class dtNavMeshQuery public class dtNavMeshQuery
{ {
private dtNavMesh m_nav; //< Pointer to navmesh data. 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 /// Must be the first function called after construction, before other
/// functions are used. /// functions are used.
@@ -209,8 +209,8 @@ public static partial class Detour
/// This function can be used multiple times. /// This function can be used multiple times.
/// Initializes the query object. /// Initializes the query object.
/// @param[in] nav Pointer to the dtNavMesh object to use for all queries. /// @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] /// @param[in] maxNodes Maximum number of search nodes. [Limits: 0 &lt; value &lt;= 65536]
/// @returns The status flags for the query. // @returns The status flags for the query.
public dtStatus init(dtNavMesh nav, int maxNodes) public dtStatus init(dtNavMesh nav, int maxNodes)
{ {
m_nav = nav; m_nav = nav;
@@ -264,7 +264,7 @@ public static partial class Detour
return DT_SUCCESS; return DT_SUCCESS;
} }
/// @name Standard Pathfinding Functions // @name Standard Pathfinding Functions
public delegate float randomFloatGenerator(); public delegate float randomFloatGenerator();
@@ -274,7 +274,7 @@ public static partial class Detour
/// @param[in] frand Function returning a random number [0..1). /// @param[in] frand Function returning a random number [0..1).
/// @param[out] randomRef The reference id of the random location. /// @param[out] randomRef The reference id of the random location.
/// @param[out] randomPt 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) public dtStatus findRandomPoint(dtQueryFilter filter, randomFloatGenerator frand, ref dtPolyRef randomRef, ref float[] randomPt)
{ {
Debug.Assert(m_nav != null); 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[in] frand Function returning a random number [0..1).
/// @param[out] randomRef The reference id of the random location. /// @param[out] randomRef The reference id of the random location.
/// @param[out] randomPt The random location. [(x, y, z)] /// @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) public dtStatus findRandomPointAroundCircle(dtPolyRef startRef, float[] centerPos, float radius, dtQueryFilter filter, randomFloatGenerator frand, ref dtPolyRef randomRef, ref float[] randomPt)
{ {
Debug.Assert(m_nav != null); 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[in] pos The position to check. [(x, y, z)]
/// @param[out] closest The closest point on the polygon. [(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. /// @param[out] posOverPoly True of the position is over the polygon.
/// @returns The status flags for the query. // @returns The status flags for the query.
/// @par // @par
/// ///
/// Uses the detail polygons to find the surface height. (Most accurate.) /// 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. /// 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] ref The reference id to the polygon.
/// @param[in] pos The position to check. [(x, y, z)] /// @param[in] pos The position to check. [(x, y, z)]
/// @param[out] closest The closest point. [(x, y, z)] /// @param[out] closest The closest point. [(x, y, z)]
/// @returns The status flags for the query. // @returns The status flags for the query.
/// @par // @par
/// ///
/// Much faster than closestPointOnPoly(). /// 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. /// 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) 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] ref The reference id of the polygon.
/// @param[in] pos A position within the xz-bounds of the polygon. [(x, y, z)] /// @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. /// @param[out] height The height at the surface of the polygon.
/// @returns The status flags for the query. // @returns The status flags for the query.
/// @par // @par
/// ///
/// Will return #DT_FAILURE if the provided position is outside the xz-bounds /// Will return #DT_FAILURE if the provided position is outside the xz-bounds
/// of the polygon. /// of the polygon.
@@ -827,8 +827,8 @@ public static partial class Detour
return DT_FAILURE | DT_INVALID_PARAM; return DT_FAILURE | DT_INVALID_PARAM;
} }
/// @} // @}
/// @name Local Query Functions // @name Local Query Functions
///@{ ///@{
/// Finds the polygon nearest to the specified center point. /// 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[in] filter The polygon filter to apply to the query.
/// @param[out] nearestRef The reference id of the nearest polygon. /// @param[out] nearestRef The reference id of the nearest polygon.
/// @param[out] nearestPt The nearest point on the polygon. [opt] [(x, y, z)] /// @param[out] nearestPt The nearest point on the polygon. [opt] [(x, y, z)]
/// @returns The status flags for the query. // @returns The status flags for the query.
/// @par // @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 /// 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. /// 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) 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] polys The reference ids of the polygons that overlap the query box.
/// @param[out] polyCount The number of polygons in the search result. /// @param[out] polyCount The number of polygons in the search result.
/// @param[in] maxPolys The maximum number of polygons the search result can hold. /// @param[in] maxPolys The maximum number of polygons the search result can hold.
/// @returns The status flags for the query. // @returns The status flags for the query.
/// @par // @par
/// ///
/// If no polygons are found, the function will return #DT_SUCCESS with a /// 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 /// 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 /// be filled to capacity. The method of choosing which polygons from the
@@ -1073,7 +1073,7 @@ public static partial class Detour
/// [(polyRef) * @p pathCount] /// [(polyRef) * @p pathCount]
/// @param[out] pathCount The number of polygons returned in the @p path array. /// @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] /// @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, /// If the end polygon cannot be reached through the navigation graph,
/// the last polygon in the path will be the nearest the end polygon. /// 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: /// Common use case:
/// -# Call initSlicedFindPath() to initialize the sliced path query. /// -# Call initSlicedFindPath() to initialize the sliced path query.
/// -# Call updateSlicedFindPath() until it returns complete. /// -# 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] startPos A position within the start polygon. [(x, y, z)]
/// @param[in] endPos A position within the end 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. /// @param[in] filter The polygon filter to apply to the query.
/// @returns The status flags for the query. // @returns The status flags for the query.
/// @par // @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! /// or finalizeSlicedFindPathPartial() may result in corrupted data!
/// ///
/// The @p filter pointer is stored and used for the duration of the sliced /// 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. /// Updates an in-progress sliced path query.
/// @param[in] maxIter The maximum number of iterations to perform. /// @param[in] maxIter The maximum number of iterations to perform.
/// @param[out] doneIters The actual number of iterations completed. [opt] /// @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) public dtStatus updateSlicedFindPath(int maxIter, ref int doneIters)
{ {
if (!dtStatusInProgress(m_query.status)) if (!dtStatusInProgress(m_query.status))
@@ -1557,7 +1557,7 @@ public static partial class Detour
/// [(polyRef) * @p pathCount] /// [(polyRef) * @p pathCount]
/// @param[out] pathCount The number of polygons returned in the @p path array. /// @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] /// @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) public dtStatus finalizeSlicedFindPath(dtPolyRef[] path, ref int pathCount, int maxPath)
{ {
pathCount = 0; pathCount = 0;
@@ -1630,7 +1630,7 @@ public static partial class Detour
/// [(polyRef) * @p pathCount] /// [(polyRef) * @p pathCount]
/// @param[out] pathCount The number of polygons returned in the @p path array. /// @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] /// @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) public dtStatus finalizeSlicedFindPathPartial(dtPolyRef[] existing, int existingSize, dtPolyRef[] path, ref int pathCount, int maxPath)
{ {
pathCount = 0; pathCount = 0;
@@ -1801,8 +1801,8 @@ public static partial class Detour
/// @param[out] straightPathCount The number of points in the straight path. /// @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] maxStraightPath The maximum number of points the straight path arrays can hold. [Limit: > 0]
/// @param[in] options Query options. (see: #dtStraightPathOptions) /// @param[in] options Query options. (see: #dtStraightPathOptions)
/// @returns The status flags for the query. // @returns The status flags for the query.
/// @par // @par
/// ///
/// This method peforms what is often called 'string pulling'. /// 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] visited The reference ids of the polygons visited during the move.
/// @param[out] visitedCount The number of 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. /// @param[in] maxVisitedSize The maximum number of polygons the @p visited array can hold.
/// @returns The status flags for the query. // @returns The status flags for the query.
/// @par // @par
/// ///
/// This method is optimized for small delta movement and a small number of /// 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 /// polygons. If used for too great a distance, the result set will form an
/// incomplete path. /// 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. /// 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. /// mesh. Use #getPolyHeight if this is needed.
/// ///
/// This method treats the end position in the same manner as /// 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] path The reference ids of the visited polygons. [opt]
/// @param[out] pathCount The number of 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. /// @param[in] maxPath The maximum number of polygons the @p path array can hold.
/// @returns The status flags for the query. // @returns The status flags for the query.
/// @par // @par
/// ///
/// This method is meant to be used for quick, short distance checks. /// 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 /// 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. /// was hit and the value of @p hitNormal is undefined.
/// ///
/// If 0 < t < 1.0 then the following applies: /// If 0 &lt; t &lt; 1.0 then the following applies:
/// ///
/// @code // @code
/// distanceToHitBorder = distanceToEndPosition * t /// distanceToHitBorder = distanceToEndPosition * t
/// hitPoint = startPos + (endPos - startPos) * t /// hitPoint = startPos + (endPos - startPos) * t
/// @endcode // @endcode
/// ///
/// <b>Use Case Restriction</b> /// <b>Use Case Restriction</b>
/// ///
@@ -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. /// 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. /// @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] resultCost The search cost from @p centerPos to the polygon. [opt]
/// @param[out] resultCount The number of polygons found. [opt] /// @param[out] resultCount The number of polygons found. [opt]
/// @param[in] maxResult The maximum number of polygons the result arrays can hold. /// @param[in] maxResult The maximum number of polygons the result arrays can hold.
/// @returns The status flags for the query. // @returns The status flags for the query.
/// @par // @par
/// ///
/// At least one result array must be provided. /// 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] resultCost The search cost from the centroid point to the polygon. [opt]
/// @param[out] resultCount The number of polygons found. /// @param[out] resultCount The number of polygons found.
/// @param[in] maxResult The maximum number of polygons the result arrays can hold. /// @param[in] maxResult The maximum number of polygons the result arrays can hold.
/// @returns The status flags for the query. // @returns The status flags for the query.
/// @par // @par
/// ///
/// The order of the result set is from least to highest cost. /// 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] /// Zero if a result polygon has no parent. [opt]
/// @param[out] resultCount The number of polygons found. /// @param[out] resultCount The number of polygons found.
/// @param[in] maxResult The maximum number of polygons the result arrays can hold. /// @param[in] maxResult The maximum number of polygons the result arrays can hold.
/// @returns The status flags for the query. // @returns The status flags for the query.
/// @par // @par
/// ///
/// This method is optimized for a small search radius and small number of result /// This method is optimized for a small search radius and small number of result
/// polygons. /// polygons.
@@ -3276,8 +3276,8 @@ public static partial class Detour
/// Or zero if the segment is a wall. [opt] [(parentRef) * @p segmentCount] /// Or zero if the segment is a wall. [opt] [(parentRef) * @p segmentCount]
/// @param[out] segmentCount The number of segments returned. /// @param[out] segmentCount The number of segments returned.
/// @param[in] maxSegments The maximum number of segments the result arrays can hold. /// @param[in] maxSegments The maximum number of segments the result arrays can hold.
/// @returns The status flags for the query. // @returns The status flags for the query.
/// @par // @par
/// ///
/// If the @p segmentRefs parameter is provided, then all polygon segments will be returned. /// If the @p segmentRefs parameter is provided, then all polygon segments will be returned.
/// Otherwise only the wall segments are 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] 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 /// @param[out] hitNormal The normalized ray formed from the wall point to the
/// source point. [(x, y, z)] /// source point. [(x, y, z)]
/// @returns The status flags for the query. // @returns The status flags for the query.
/// @par // @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 /// radius. In this case the values of @p hitPos and @p hitNormal are
/// undefined. /// undefined.
/// ///
@@ -3643,9 +3643,9 @@ public static partial class Detour
return status; return status;
} }
/// @} // @}
/// @name Miscellaneous Functions // @name Miscellaneous Functions
/// @{ // @{
/// Returns true if the polygon reference is valid and passes the filter restrictions. /// Returns true if the polygon reference is valid and passes the filter restrictions.
/// @param[in] ref The polygon reference to check. /// @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. /// Returns true if the polygon reference is in the closed list.
/// @param[in] ref The reference id of the polygon to check. /// @param[in] ref The reference id of the polygon to check.
/// @returns True if the polygon is in closed list. // @returns True if the polygon is in closed list.
/// @par // @par
/// ///
/// The closed list is the list of polygons that were fully evaluated during /// The closed list is the list of polygons that were fully evaluated during
/// the last navigation graph search. (A* or Dijkstra) /// 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. /// 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() public dtNavMesh getAttachedNavMesh()
{ {
return m_nav; return m_nav;
+1 -1
View File
@@ -51,7 +51,7 @@ namespace Framework.Serialization
return CreateObject<T>(Encoding.UTF8.GetBytes(split ? jsonData.Split(new[] { ':' }, 2)[1] : jsonData)); return CreateObject<T>(Encoding.UTF8.GetBytes(split ? jsonData.Split(new[] { ':' }, 2)[1] : jsonData));
} }
public static T CreateObject<T>(byte[] jsonData) => (T)CreateObject<T>(new MemoryStream(jsonData)); public static T CreateObject<T>(byte[] jsonData) => CreateObject<T>(new MemoryStream(jsonData));
public static object CreateObject(Stream jsonData, Type type) public static object CreateObject(Stream jsonData, Type type)
{ {
+11 -8
View File
@@ -66,6 +66,9 @@ namespace System.Collections.Generic
} }
public static KeyValuePair<TKey, TValue> Find<TKey, TValue>(this IDictionary<TKey, TValue> dict, TKey key) public static KeyValuePair<TKey, TValue> Find<TKey, TValue>(this IDictionary<TKey, TValue> dict, TKey key)
{ {
if (!dict.ContainsKey(key))
return default(KeyValuePair<TKey, TValue>);
return new KeyValuePair<TKey, TValue>(key, dict[key]); return new KeyValuePair<TKey, TValue>(key, dict[key]);
} }
@@ -113,17 +116,17 @@ namespace System.Collections.Generic
} }
} }
public static void RandomResize<T>(this ICollection<T> list, Predicate<T> predicate, uint size) public static void RandomResize<T>(this List<T> list, Predicate<T> predicate, uint size)
{ {
List<T> listCopy = new List<T>(); for (var i = 0; i < list.Count; ++i)
foreach (var obj in list) {
if (predicate(obj)) var obj = list[i];
listCopy.Add(obj); if (!predicate(obj))
list.Remove(obj);
}
if (size != 0) if (size != 0)
listCopy.Resize(size); list.Resize(size);
list = listCopy;
} }
public static T SelectRandom<T>(this IEnumerable<T> source) public static T SelectRandom<T>(this IEnumerable<T> source)
+2 -2
View File
@@ -72,7 +72,7 @@ namespace System
for (int i = 0; i < length; i++) for (int i = 0; i < length; i++)
{ {
int randValue = -1; int randValue;
do do
{ {
@@ -128,7 +128,7 @@ namespace System
public static BigInteger ToBigInteger<T>(this T value, bool isBigEndian = false) public static BigInteger ToBigInteger<T>(this T value, bool isBigEndian = false)
{ {
var ret = BigInteger.Zero; BigInteger ret;
switch (typeof(T).Name) switch (typeof(T).Name)
{ {
+2 -2
View File
@@ -100,9 +100,9 @@ public class RandomHelper
public static T RAND<T>(params T[] args) public static T RAND<T>(params T[] args)
{ {
int rand = IRand(0, args.Length - 1); int randIndex = IRand(0, args.Length - 1);
return args[rand]; return args[randIndex];
} }
} }
+1 -1
View File
@@ -241,7 +241,7 @@ namespace Game.AI
} }
public override bool CanAIAttack(Unit victim) 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) if (!me.IsWithinCombatRange(me.GetVictim(), me.m_CombatDistance)
|| (m_minRange != 0 && me.IsWithinCombatRange(me.GetVictim(), m_minRange))) || (m_minRange != 0 && me.IsWithinCombatRange(me.GetVictim(), m_minRange)))
return false; return false;
+1 -1
View File
@@ -546,7 +546,7 @@ namespace Game.AI
if (me.GetVictim() && me.GetVictim() != victim) if (me.GetVictim() && me.GetVictim() != victim)
{ {
// Check if our owner selected this target and clicked "attack" // Check if our owner selected this target and clicked "attack"
Unit ownerTarget = null; Unit ownerTarget;
Player owner = me.GetCharmerOrOwner().ToPlayer(); Player owner = me.GetCharmerOrOwner().ToPlayer();
if (owner) if (owner)
ownerTarget = owner.GetSelectedUnit(); ownerTarget = owner.GetSelectedUnit();
-1
View File
@@ -57,7 +57,6 @@ namespace Game.AI
if (victim == null || !victim.isTargetableForAttack() || !me.IsWithinDistInMap(victim, max_range) || if (victim == null || !victim.isTargetableForAttack() || !me.IsWithinDistInMap(victim, max_range) ||
me.IsFriendlyTo(victim) || !me.CanSeeOrDetect(victim)) me.IsFriendlyTo(victim) || !me.CanSeeOrDetect(victim))
{ {
victim = null;
var u_check = new NearestAttackableUnitInObjectRangeCheck(me, me.GetCharmerOrOwnerOrSelf(), max_range); var u_check = new NearestAttackableUnitInObjectRangeCheck(me, me.GetCharmerOrOwnerOrSelf(), max_range);
var checker = new UnitLastSearcher(me, u_check); var checker = new UnitLastSearcher(me, u_check);
Cell.VisitAllObjects(me, checker, max_range); Cell.VisitAllObjects(me, checker, max_range);
+1 -3
View File
@@ -133,12 +133,10 @@ namespace Game.AI
uint spellCount = 0; uint spellCount = 0;
SpellInfo tempSpell = null;
//Check if each spell is viable(set it to null if not) //Check if each spell is viable(set it to null if not)
for (uint i = 0; i < SharedConst.MaxCreatureSpells; i++) 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 //This spell doesn't exist
if (tempSpell == null) if (tempSpell == null)
@@ -142,7 +142,7 @@ namespace Game.AI
if (!HasFollowState(eFollowState.Inprogress) || m_uiLeaderGUID.IsEmpty() || m_pQuestForFollow == null) if (!HasFollowState(eFollowState.Inprogress) || m_uiLeaderGUID.IsEmpty() || m_pQuestForFollow == null)
return; return;
/// @todo need a better check for quests with time limit. // @todo need a better check for quests with time limit.
Player player = GetLeaderForFollower(); Player player = GetLeaderForFollower();
if (player) if (player)
{ {
@@ -1255,7 +1255,7 @@ namespace Game.AI
if (e.GetScriptType() != SmartScriptType.Creature) if (e.GetScriptType() != SmartScriptType.Creature)
return true; return true;
uint entry = 0; uint entry;
if (e.GetEventType() == SmartEvents.TextOver) if (e.GetEventType() == SmartEvents.TextOver)
{ {
entry = e.Event.textOver.creatureEntry; entry = e.Event.textOver.creatureEntry;
+1 -1
View File
@@ -3272,7 +3272,7 @@ namespace Game.AI
if (me == null || !me.IsInCombat()) if (me == null || !me.IsInCombat())
return; return;
List<WorldObject> _targets = null; List<WorldObject> _targets;
switch (e.GetTargetType()) switch (e.GetTargetType())
{ {
@@ -180,13 +180,13 @@ namespace Game.Achievements
public virtual void CompletedAchievement(AchievementRecord entry, Player referencePlayer) { } public virtual void CompletedAchievement(AchievementRecord entry, Player referencePlayer) { }
public Func<KeyValuePair<uint, CompletedAchievementData>, AchievementRecord> VisibleAchievementCheck = new Func<KeyValuePair<uint, CompletedAchievementData>, AchievementRecord>(value => public Func<KeyValuePair<uint, CompletedAchievementData>, AchievementRecord> VisibleAchievementCheck = value =>
{ {
AchievementRecord achievement = CliDB.AchievementStorage.LookupByKey(value.Key); AchievementRecord achievement = CliDB.AchievementStorage.LookupByKey(value.Key);
if (achievement != null && !achievement.Flags.HasAnyFlag(AchievementFlags.Hidden)) if (achievement != null && !achievement.Flags.HasAnyFlag(AchievementFlags.Hidden))
return achievement; return achievement;
return null; return null;
}); };
protected Dictionary<uint, CompletedAchievementData> _completedAchievements = new Dictionary<uint, CompletedAchievementData>(); protected Dictionary<uint, CompletedAchievementData> _completedAchievements = new Dictionary<uint, CompletedAchievementData>();
protected uint _achievementPoints; protected uint _achievementPoints;
@@ -1045,7 +1045,7 @@ namespace Game.Achievements
public bool IsRealmCompleted(AchievementRecord achievement) public bool IsRealmCompleted(AchievementRecord achievement)
{ {
var time = _allCompletedAchievements.LookupByKey(achievement.Id); var time = _allCompletedAchievements.LookupByKey(achievement.Id);
if (time == null) if (time == default(DateTime))
return false; return false;
if (time == DateTime.MinValue) if (time == DateTime.MinValue)
@@ -694,7 +694,7 @@ namespace Game.BattleFields
public override void OnPlayerLeaveWar(Player player) 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()) if (!player.GetSession().PlayerLogout())
{ {
Creature vehicle = player.GetVehicleCreatureBase(); Creature vehicle = player.GetVehicleCreatureBase();
@@ -380,21 +380,21 @@ namespace Game.BattleFields
struct WGAchievements struct WGAchievements
{ {
public const uint WinWg = 1717; public const uint WinWg = 1717;
public const uint WinWg100 = 1718; /// @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 WgGnomeslaughter = 1723; // @Todo: Has To Be Implemented
public const uint WgTowerDestroy = 1727; public const uint WgTowerDestroy = 1727;
public const uint DestructionDerbyA = 1737; /// @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 WgTowerCannonKill = 1751; // @Todo: Has To Be Implemented
public const uint WgMasterA = 1752; /// @Todo: Has To Be Implemented public const uint WgMasterA = 1752; // @Todo: Has To Be Implemented
public const uint WinWgTimer10 = 1755; public const uint WinWgTimer10 = 1755;
public const uint StoneKeeper50 = 2085; /// @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 StoneKeeper100 = 2086; // @Todo: Has To Be Implemented
public const uint StoneKeeper250 = 2087; /// @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 StoneKeeper500 = 2088; // @Todo: Has To Be Implemented
public const uint StoneKeeper1000 = 2089; /// @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 WgRanger = 2199; // @Todo: Has To Be Implemented
public const uint DestructionDerbyH = 2476; /// @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 WgMasterH = 2776; // @Todo: Has To Be Implemented
} }
struct WGSpells struct WGSpells
@@ -693,7 +693,7 @@ namespace Game.BattleFields
public uint towerEntry; // Gameobject id of tower public uint towerEntry; // Gameobject id of tower
public WintergraspGameObjectData[] GameObject = new WintergraspGameObjectData[6]; // Gameobject position and entry (Horde/Alliance) 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]; public WintergraspObjectPositionData[] CreatureBottom = new WintergraspObjectPositionData[9];
} }
+1 -1
View File
@@ -227,9 +227,9 @@ namespace Game.BattleGrounds
{ {
if (GetReviveQueueSize() != 0) if (GetReviveQueueSize() != 0)
{ {
Creature sh = null;
foreach (var pair in m_ReviveQueue) foreach (var pair in m_ReviveQueue)
{ {
Creature sh = null;
Player player = Global.ObjAccessor.FindPlayer(pair.Value); Player player = Global.ObjAccessor.FindPlayer(pair.Value);
if (!player) if (!player)
continue; continue;
@@ -282,7 +282,7 @@ namespace Game.BattleGrounds.Zones
EventTeamLostPoint(player, point); 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 (point == EotSPoints.FelReaver && m_PointOwnedByTeam[point] == player.GetTeam())
if (m_FlagState != 0 && GetFlagPickerGUID() == player.GetGUID()) if (m_FlagState != 0 && GetFlagPickerGUID() == player.GetGUID())
if (player.GetDistance(2044.0f, 1729.729f, 1190.03f) < 3.0f) if (player.GetDistance(2044.0f, 1729.729f, 1190.03f) < 3.0f)
+1 -1
View File
@@ -574,7 +574,7 @@ namespace Game.Chat
Log.outDebug(LogFilter.ChatSystem, "SMSG_CHANNEL_LIST {0} Channel: {1}", player.GetSession().GetPlayerInfo(), channelName); Log.outDebug(LogFilter.ChatSystem, "SMSG_CHANNEL_LIST {0} Channel: {1}", player.GetSession().GetPlayerInfo(), channelName);
ChannelListResponse list = new ChannelListResponse(); ChannelListResponse list = new ChannelListResponse();
list.Display = true; /// always true? list.Display = true; // always true?
list.Channel = channelName; list.Channel = channelName;
list.ChannelFlags = GetFlags(); list.ChannelFlags = GetFlags();
+2 -2
View File
@@ -52,11 +52,11 @@ namespace Game.Chat
if (text.Length < 2) if (text.Length < 2)
return false; return false;
/// ignore messages staring from many dots. // ignore messages staring from many dots.
if ((text[0] == '.' && text[1] == '.') || (text[0] == '!' && text[1] == '!')) if ((text[0] == '.' && text[1] == '.') || (text[0] == '!' && text[1] == '!'))
return false; 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] == '.') if (text[0] == '!' || text[0] == '.')
text = text.Substring(1); text = text.Substring(1);
+5 -5
View File
@@ -47,7 +47,7 @@ namespace Game.Chat
"Unknown security level: Notify technician for details.")); "Unknown security level: Notify technician for details."));
// RBAC required display - is not displayed for console // RBAC required display - is not displayed for console
if (pwConfig == 2 && session != null && hasRBAC) if (pwConfig == 2 && hasRBAC)
handler.SendSysMessage(CypherStrings.RbacEmailRequired); handler.SendSysMessage(CypherStrings.RbacEmailRequired);
// Email display if sufficient rights // Email display if sufficient rights
@@ -635,8 +635,8 @@ namespace Game.Chat
return false; return false;
} }
/// can set email only for target with less security // can set email only for target with less security
/// This also restricts setting handler's own email. // This also restricts setting handler's own email.
if (handler.HasLowerSecurityAccount(null, targetAccountId, true)) if (handler.HasLowerSecurityAccount(null, targetAccountId, true))
return false; return false;
@@ -696,8 +696,8 @@ namespace Game.Chat
return false; return false;
} }
/// can set email only for target with less security // can set email only for target with less security
/// This also restricts setting handler's own email. // This also restricts setting handler's own email.
if (handler.HasLowerSecurityAccount(null, targetAccountId, true)) if (handler.HasLowerSecurityAccount(null, targetAccountId, true))
return false; return false;
+1 -1
View File
@@ -146,7 +146,7 @@ namespace Game.Chat.Commands
if (!uint.TryParse(durationStr, out uint tempValue) || tempValue > 0) if (!uint.TryParse(durationStr, out uint tempValue) || tempValue > 0)
{ {
if (WorldConfig.GetBoolValue(WorldCfg.ShowBanInWorld)) 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 else
handler.SendSysMessage(CypherStrings.BanYoubanned, nameOrIP, Time.secsToTimeString(Time.TimeStringToSecs(durationStr), true), reasonStr); handler.SendSysMessage(CypherStrings.BanYoubanned, nameOrIP, Time.secsToTimeString(Time.TimeStringToSecs(durationStr), true), reasonStr);
} }
@@ -306,7 +306,7 @@ namespace Game.Chat
stmt.AddValue(0, AtLoginFlags.ChangeRace); stmt.AddValue(0, AtLoginFlags.ChangeRace);
if (target) if (target)
{ {
/// @todo add text into database // @todo add text into database
handler.SendSysMessage(CypherStrings.CustomizePlayer, handler.GetNameLink(target)); handler.SendSysMessage(CypherStrings.CustomizePlayer, handler.GetNameLink(target));
target.SetAtLoginFlag(AtLoginFlags.ChangeRace); target.SetAtLoginFlag(AtLoginFlags.ChangeRace);
stmt.AddValue(1, target.GetGUID().GetCounter()); stmt.AddValue(1, target.GetGUID().GetCounter());
@@ -314,7 +314,7 @@ namespace Game.Chat
else else
{ {
string oldNameLink = handler.playerLink(targetName); string oldNameLink = handler.playerLink(targetName);
/// @todo add text into database // @todo add text into database
handler.SendSysMessage(CypherStrings.CustomizePlayerGuid, oldNameLink, targetGuid.ToString()); handler.SendSysMessage(CypherStrings.CustomizePlayerGuid, oldNameLink, targetGuid.ToString());
stmt.AddValue(1, targetGuid.GetCounter()); stmt.AddValue(1, targetGuid.GetCounter());
} }
+1 -1
View File
@@ -619,7 +619,7 @@ namespace Game.Chat
return false; return false;
target.SetUnitMovementFlags((MovementFlag)moveFlags); 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)) if (!string.IsNullOrEmpty(mask2))
{ {
@@ -609,13 +609,13 @@ namespace Game.Chat
if (string.IsNullOrEmpty(state)) if (string.IsNullOrEmpty(state))
return false; return false;
if (!uint.TryParse(state, out uint objectState)) if (!int.TryParse(state, out int objectState))
return false; return false;
if (objectType < 4) if (objectType < 4)
obj.SetByteValue(GameObjectFields.Bytes1, (byte)objectType, (byte)objectState); obj.SetByteValue(GameObjectFields.Bytes1, (byte)objectType, (byte)objectState);
else if (objectType == 4) else if (objectType == 4)
obj.SendCustomAnim(objectState); obj.SendCustomAnim((uint)objectState);
else if (objectType == 5) else if (objectType == 5)
{ {
if (objectState < 0 || objectState > (uint)GameObjectDestructibleState.Rebuilding) if (objectState < 0 || objectState > (uint)GameObjectDestructibleState.Rebuilding)
+1 -1
View File
@@ -199,7 +199,7 @@ namespace Game.Chat.Commands
uint ownerAccountId = result.Read<uint>(4); uint ownerAccountId = result.Read<uint>(4);
string ownerName = result.Read<string>(5); string ownerName = result.Read<string>(5);
string itemPos = ""; string itemPos;
if (Player.IsEquipmentPos((byte)itemBag, itemSlot)) if (Player.IsEquipmentPos((byte)itemBag, itemSlot))
itemPos = "[equipped]"; itemPos = "[equipped]";
else if (Player.IsInventoryPos((byte)itemBag, itemSlot)) else if (Player.IsInventoryPos((byte)itemBag, itemSlot))
+1 -1
View File
@@ -618,7 +618,7 @@ namespace Game.Chat
Global.ObjectMgr.LoadQuests(); Global.ObjectMgr.LoadQuests();
handler.SendGlobalGMSysMessage("DB table `quest_template` (quest definitions) reloaded."); 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..."); Log.outInfo(LogFilter.Server, "Re-Loading GameObjects for quests...");
Global.ObjectMgr.LoadGameObjectForQuests(); Global.ObjectMgr.LoadGameObjectForQuests();
handler.SendGlobalGMSysMessage("Data GameObjects for quests reloaded."); handler.SendGlobalGMSysMessage("Data GameObjects for quests reloaded.");
+5 -5
View File
@@ -56,7 +56,7 @@ namespace Game.Chat.Commands
// from console show not existed sender // from console show not existed sender
MailSender sender = new MailSender(MailMessageType.Normal, handler.GetSession() ? handler.GetSession().GetPlayer().GetGUID().GetCounter() : 0, MailStationery.Gm); 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(); SQLTransaction trans = new SQLTransaction();
new MailDraft(subject, text) new MailDraft(subject, text)
.SendMailTo(trans, new MailReceiver(target, targetGuid.GetCounter()), sender); .SendMailTo(trans, new MailReceiver(target, targetGuid.GetCounter()), sender);
@@ -102,7 +102,7 @@ namespace Game.Chat.Commands
// get from tail next item str // get from tail next item str
StringArguments itemStr; StringArguments itemStr;
while ((itemStr = new StringArguments(tail.NextString(" "))) != null) while (!(itemStr = new StringArguments(tail.NextString(" "))).Empty())
{ {
// parse item str // parse item str
string itemIdStr = itemStr.NextString(":"); string itemIdStr = itemStr.NextString(":");
@@ -172,7 +172,7 @@ namespace Game.Chat.Commands
[Command("money", RBACPermissions.CommandSendMoney, true)] [Command("money", RBACPermissions.CommandSendMoney, true)]
static bool HandleSendMoneyCommand(StringArguments args, CommandHandler handler) static bool HandleSendMoneyCommand(StringArguments args, CommandHandler handler)
{ {
/// format: name "subject text" "mail text" money // format: name "subject text" "mail text" money
Player receiver; Player receiver;
ObjectGuid receiverGuid; ObjectGuid receiverGuid;
@@ -221,7 +221,7 @@ namespace Game.Chat.Commands
[Command("message", RBACPermissions.CommandSendMessage, true)] [Command("message", RBACPermissions.CommandSendMessage, true)]
static bool HandleSendMessageCommand(StringArguments args, CommandHandler handler) static bool HandleSendMessageCommand(StringArguments args, CommandHandler handler)
{ {
/// - Find the player // - Find the player
Player player; Player player;
if (!handler.extractPlayerTarget(args, out player)) if (!handler.extractPlayerTarget(args, out player))
return false; return false;
@@ -237,7 +237,7 @@ namespace Game.Chat.Commands
return false; return false;
} }
/// - Send the message // - Send the message
player.GetSession().SendNotification("{0}", msgStr); player.GetSession().SendNotification("{0}", msgStr);
player.GetSession().SendNotification("|cffff0000[Message from administrator]:|r"); player.GetSession().SendNotification("|cffff0000[Message from administrator]:|r");
+1 -1
View File
@@ -240,7 +240,7 @@ namespace Game.Collision
meshTree.readFromFile(reader); meshTree.readFromFile(reader);
// write liquid data // write liquid data
if (reader.ReadStringFromChars(4).ToString() != "LIQU") if (reader.ReadStringFromChars(4) != "LIQU")
return false; return false;
chunkSize = reader.ReadUInt32(); chunkSize = reader.ReadUInt32();
+1 -1
View File
@@ -1504,7 +1504,7 @@ namespace Game
} }
case ConditionTypes.UnitState: 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); Log.outError(LogFilter.Sql, "{0} has non existing UnitState in value1 ({1}), skipped.", cond.ToString(true), cond.ConditionValue1);
return false; return false;
+1 -1
View File
@@ -2122,7 +2122,7 @@ namespace Game.DungeonFinding
public bool isNew; public bool isNew;
public List<ObjectGuid> queues = new List<ObjectGuid>(); public List<ObjectGuid> queues = new List<ObjectGuid>();
public List<ulong> showorder = new List<ulong>(); public List<ulong> showorder = new List<ulong>();
public Dictionary<ObjectGuid, LfgProposalPlayer> players = new Dictionary<ObjectGuid, LfgProposalPlayer>(); ///< Players data public Dictionary<ObjectGuid, LfgProposalPlayer> players = new Dictionary<ObjectGuid, LfgProposalPlayer>(); // Players data
} }
public class LfgRoleCheck public class LfgRoleCheck
+2 -2
View File
@@ -60,7 +60,7 @@ namespace Game.DungeonFinding
} }
Global.LFGMgr.SetTeam(player.GetGUID(), player.GetTeam()); 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) public override void OnMapChanged(Player player)
@@ -157,7 +157,7 @@ namespace Game.DungeonFinding
if (isLFG && method == RemoveMethod.Kick) // Player have been kicked 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 = ""; string str_reason = "";
if (!string.IsNullOrEmpty(reason)) if (!string.IsNullOrEmpty(reason))
str_reason = reason; str_reason = reason;
@@ -740,7 +740,7 @@ namespace Game.Entities
public bool HasSplines() { return !_spline.empty(); } public bool HasSplines() { return !_spline.empty(); }
public Spline GetSpline() { return _spline; } 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; ObjectGuid _targetGuid;
@@ -121,41 +121,39 @@ namespace Game.Entities
switch (TriggerType) switch (TriggerType)
{ {
case AreaTriggerTypes.Sphere: case AreaTriggerTypes.Sphere:
{ {
MaxSearchRadius = Math.Max(SphereDatas.Radius, SphereDatas.RadiusTarget); MaxSearchRadius = Math.Max(SphereDatas.Radius, SphereDatas.RadiusTarget);
break; break;
} }
case AreaTriggerTypes.Box: case AreaTriggerTypes.Box:
{
fixed (float* ptr = BoxDatas.Extents)
{ {
unsafe MaxSearchRadius = (float) Math.Sqrt(ptr[0] * ptr[0] / 4 + ptr[1] * ptr[1] / 4);
{
fixed (float* ptr = BoxDatas.Extents)
{
MaxSearchRadius = (float)Math.Sqrt(ptr[0] * ptr[0] / 4 + ptr[1] * ptr[1] / 4);
}
}
break;
} }
break;
}
case AreaTriggerTypes.Polygon: case AreaTriggerTypes.Polygon:
{
if (PolygonDatas.Height <= 0.0f)
PolygonDatas.Height = 1.0f;
foreach (Vector2 vertice in PolygonVertices)
{ {
if (PolygonDatas.Height <= 0.0f) float pointDist = vertice.GetLength();
PolygonDatas.Height = 1.0f;
foreach (Vector2 vertice in PolygonVertices) if (pointDist > MaxSearchRadius)
{ MaxSearchRadius = pointDist;
float pointDist = vertice.GetLength();
if (pointDist > MaxSearchRadius)
MaxSearchRadius = pointDist;
}
break;
} }
break;
}
case AreaTriggerTypes.Cylinder: case AreaTriggerTypes.Cylinder:
{ {
MaxSearchRadius = CylinderDatas.Radius; MaxSearchRadius = CylinderDatas.Radius;
break; break;
} }
default: default:
break; break;
} }
+3 -3
View File
@@ -40,7 +40,7 @@ namespace Game.Entities
public override void AddToWorld() public override void AddToWorld()
{ {
///- Register the Conversation for guid lookup and for caster //- Register the Conversation for guid lookup and for caster
if (!IsInWorld) if (!IsInWorld)
{ {
GetMap().GetObjectsStore().Add(GetGUID(), this); GetMap().GetObjectsStore().Add(GetGUID(), this);
@@ -50,7 +50,7 @@ namespace Game.Entities
public override void RemoveFromWorld() 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) if (IsInWorld)
{ {
base.RemoveFromWorld(); base.RemoveFromWorld();
@@ -110,7 +110,7 @@ namespace Game.Entities
SetMap(map); SetMap(map);
Relocate(pos); Relocate(pos);
base._Create(ObjectGuid.Create(HighGuid.Conversation, GetMapId(), conversationEntry, lowGuid)); _Create(ObjectGuid.Create(HighGuid.Conversation, GetMapId(), conversationEntry, lowGuid));
PhasingHandler.InheritPhaseShift(this, creator); PhasingHandler.InheritPhaseShift(this, creator);
SetEntry(conversationEntry); SetEntry(conversationEntry);
+1 -1
View File
@@ -1177,7 +1177,7 @@ namespace Game.Entities
SetModifierValue(UnitMods.AttackPower, UnitModifierType.BaseValue, stats.AttackPower); SetModifierValue(UnitMods.AttackPower, UnitModifierType.BaseValue, stats.AttackPower);
SetModifierValue(UnitMods.AttackPowerRanged, UnitModifierType.BaseValue, stats.RangedAttackPower); 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); SetModifierValue(UnitMods.Armor, UnitModifierType.BaseValue, armor);
} }
+4 -4
View File
@@ -73,20 +73,20 @@ namespace Game.Misc
/// <param name="action">action Custom action given to OnGossipHello.</param> /// <param name="action">action Custom action given to OnGossipHello.</param>
public void AddMenuItem(uint menuId, uint optionIndex, uint sender, uint action) 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); var bounds = Global.ObjectMgr.GetGossipMenuItemsMapBounds(menuId);
/// Return if there are none. // Return if there are none.
if (bounds.Empty()) if (bounds.Empty())
return; return;
/// Iterate over each of them. // Iterate over each of them.
foreach (var item in bounds) foreach (var item in bounds)
{ {
// Find the one with the given menu item id. // Find the one with the given menu item id.
if (item.OptionIndex != optionIndex) if (item.OptionIndex != optionIndex)
continue; continue;
/// Store texts for localization. // Store texts for localization.
string strOptionText = "", strBoxText = ""; string strOptionText = "", strBoxText = "";
BroadcastTextRecord optionBroadcastText = CliDB.BroadcastTextStorage.LookupByKey(item.OptionBroadcastTextId); BroadcastTextRecord optionBroadcastText = CliDB.BroadcastTextStorage.LookupByKey(item.OptionBroadcastTextId);
BroadcastTextRecord boxBroadcastText = CliDB.BroadcastTextStorage.LookupByKey(item.BoxBroadcastTextId); BroadcastTextRecord boxBroadcastText = CliDB.BroadcastTextStorage.LookupByKey(item.BoxBroadcastTextId);
@@ -396,16 +396,16 @@ namespace Game.Entities
case GameObjectTypes.Trap: case GameObjectTypes.Trap:
{ {
// Arming Time for GAMEOBJECT_TYPE_TRAP (6) // Arming Time for GAMEOBJECT_TYPE_TRAP (6)
GameObjectTemplate m_goInfo = GetGoInfo(); GameObjectTemplate goInfo = GetGoInfo();
// Bombs // Bombs
Unit owner = GetOwner(); Unit owner = GetOwner();
if (m_goInfo.Trap.charges == 2) if (goInfo.Trap.charges == 2)
m_cooldownTime = (uint)Time.UnixTime + 10; // Hardcoded tooltip value m_cooldownTime = (uint)Time.UnixTime + 10; // Hardcoded tooltip value
else if (owner) else if (owner)
{ {
if (owner.IsInCombat()) if (owner.IsInCombat())
m_cooldownTime = (uint)Time.UnixTime + m_goInfo.Trap.startDelay; m_cooldownTime = (uint)Time.UnixTime + goInfo.Trap.startDelay;
} }
m_lootState = LootState.Ready; m_lootState = LootState.Ready;
break; break;
@@ -1552,7 +1552,7 @@ namespace Game.Entities
player.UpdateFishingSkill(); 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); GameObject fishingPool = LookupFishingHoleAround(20.0f + SharedConst.ContactDistance);
// If fishing skill is high enough, or if fishing on a pool, send correct loot. // If fishing skill is high enough, or if fishing on a pool, send correct loot.
+2 -2
View File
@@ -2563,13 +2563,13 @@ namespace Game.Entities
{ {
Log.outDebug(LogFilter.Spells, "Player.AddSpellMod {0}", mod.spellId); Log.outDebug(LogFilter.Spells, "Player.AddSpellMod {0}", mod.spellId);
/// First, manipulate our spellmodifier container // First, manipulate our spellmodifier container
if (apply) if (apply)
m_spellMods[(int)mod.op][(int)mod.type].Add(mod); m_spellMods[(int)mod.op][(int)mod.type].Add(mod);
else else
m_spellMods[(int)mod.op][(int)mod.type].Remove(mod); m_spellMods[(int)mod.op][(int)mod.type].Remove(mod);
/// Now, send spellmodifier packet // Now, send spellmodifier packet
if (!IsLoading()) if (!IsLoading())
{ {
ServerOpcodes opcode = (mod.type == SpellModType.Flat ? ServerOpcodes.SetFlatSpellModifier : ServerOpcodes.SetPctSpellModifier); ServerOpcodes opcode = (mod.type == SpellModType.Flat ? ServerOpcodes.SetFlatSpellModifier : ServerOpcodes.SetPctSpellModifier);
+9 -9
View File
@@ -1952,7 +1952,7 @@ namespace Game.Entities
//move player's guid into HateOfflineList of those mobs //move player's guid into HateOfflineList of those mobs
//which can't swim and move guid back into ThreatList when //which can't swim and move guid back into ThreatList when
//on surface. //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; m_isInWater = apply;
// remove auras that need water/land // remove auras that need water/land
@@ -5283,7 +5283,7 @@ namespace Game.Entities
packet.Level = level; packet.Level = level;
packet.HealthDelta = 0; packet.HealthDelta = 0;
/// @todo find some better solution // @todo find some better solution
packet.PowerDelta[0] = (int)basemana - (int)GetCreateMana(); packet.PowerDelta[0] = (int)basemana - (int)GetCreateMana();
packet.PowerDelta[1] = 0; packet.PowerDelta[1] = 0;
packet.PowerDelta[2] = 0; packet.PowerDelta[2] = 0;
@@ -5584,18 +5584,18 @@ namespace Game.Entities
loginSetTimeSpeed.NewSpeed = TimeSpeed; loginSetTimeSpeed.NewSpeed = TimeSpeed;
loginSetTimeSpeed.GameTime = (uint)Global.WorldMgr.GetGameTime(); loginSetTimeSpeed.GameTime = (uint)Global.WorldMgr.GetGameTime();
loginSetTimeSpeed.ServerTime = (uint)Global.WorldMgr.GetGameTime(); loginSetTimeSpeed.ServerTime = (uint)Global.WorldMgr.GetGameTime();
loginSetTimeSpeed.GameTimeHolidayOffset = 0; /// @todo loginSetTimeSpeed.GameTimeHolidayOffset = 0; // @todo
loginSetTimeSpeed.ServerTimeHolidayOffset = 0; /// @todo loginSetTimeSpeed.ServerTimeHolidayOffset = 0; // @todo
SendPacket(loginSetTimeSpeed); SendPacket(loginSetTimeSpeed);
// SMSG_WORLD_SERVER_INFO // SMSG_WORLD_SERVER_INFO
WorldServerInfo worldServerInfo = new WorldServerInfo(); WorldServerInfo worldServerInfo = new WorldServerInfo();
worldServerInfo.InstanceGroupSize.Set(GetMap().GetMapDifficulty().MaxPlayers); /// @todo worldServerInfo.InstanceGroupSize.Set(GetMap().GetMapDifficulty().MaxPlayers); // @todo
worldServerInfo.IsTournamentRealm = 0; /// @todo worldServerInfo.IsTournamentRealm = 0; // @todo
worldServerInfo.RestrictedAccountMaxLevel.Clear(); /// @todo worldServerInfo.RestrictedAccountMaxLevel.Clear(); // @todo
worldServerInfo.RestrictedAccountMaxMoney.Clear(); /// @todo worldServerInfo.RestrictedAccountMaxMoney.Clear(); // @todo
worldServerInfo.DifficultyID = (uint)GetMap().GetDifficultyID(); worldServerInfo.DifficultyID = (uint)GetMap().GetDifficultyID();
// worldServerInfo.XRealmPvpAlert; /// @todo // worldServerInfo.XRealmPvpAlert; // @todo
SendPacket(worldServerInfo); SendPacket(worldServerInfo);
// Spell modifiers // Spell modifiers
+1 -1
View File
@@ -232,7 +232,7 @@ namespace Game.Entities
public override void UpdateObjectVisibilityOnCreate() public override void UpdateObjectVisibilityOnCreate()
{ {
base.UpdateObjectVisibility(true); UpdateObjectVisibility(true);
} }
public void SetTempSummonType(TempSummonType type) public void SetTempSummonType(TempSummonType type)
+1 -1
View File
@@ -2411,7 +2411,7 @@ namespace Game.Entities
bool defaultPrevented = false; 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; currentAbsorb = (int)tempAbsorb;
if (defaultPrevented) if (defaultPrevented)
+3 -3
View File
@@ -476,11 +476,11 @@ namespace Game.Entities
hitOutCome = _hitOutCome; hitOutCome = _hitOutCome;
} }
public uint absorbed_damage { get; set; } public uint absorbed_damage { get; }
public uint mitigated_damage { get; set; } public uint mitigated_damage { get; set; }
public WeaponAttackType attackType { get; set; } public WeaponAttackType attackType { get; }
public MeleeHitOutcome hitOutCome { get; set; } public MeleeHitOutcome hitOutCome { get; }
} }
public class DispelInfo public class DispelInfo
+5 -6
View File
@@ -2243,7 +2243,7 @@ namespace Game.Entities
spellHealLog.Crit = critical; spellHealLog.Crit = critical;
/// @todo: 6.x Has to be implemented // @todo: 6.x Has to be implemented
/* /*
var hasCritRollMade = spellHealLog.WriteBit("HasCritRollMade"); var hasCritRollMade = spellHealLog.WriteBit("HasCritRollMade");
var hasCritRollNeeded = spellHealLog.WriteBit("HasCritRollNeeded"); var hasCritRollNeeded = spellHealLog.WriteBit("HasCritRollNeeded");
@@ -2494,7 +2494,7 @@ namespace Game.Entities
spellLogEffect.AbsorbedOrAmplitude = info.absorb; spellLogEffect.AbsorbedOrAmplitude = info.absorb;
spellLogEffect.Resisted = info.resist; spellLogEffect.Resisted = info.resist;
spellLogEffect.Crit = info.critical; spellLogEffect.Crit = info.critical;
/// @todo: implement debug info // @todo: implement debug info
SandboxScalingData sandboxScalingData = new SandboxScalingData(); SandboxScalingData sandboxScalingData = new SandboxScalingData();
Unit caster = Global.ObjAccessor.GetUnit(this, aura.GetCasterGUID()); Unit caster = Global.ObjAccessor.GetUnit(this, aura.GetCasterGUID());
@@ -4181,10 +4181,9 @@ namespace Game.Entities
} }
bool remove = false; bool remove = false;
var appliedAuraList = GetAppliedAuras(); for (var i = 0; i < m_appliedAuras.KeyValueList.Count; i++)
for (var i = 0; i < appliedAuraList.Count; i++)
{ {
var app = appliedAuraList[i]; var app = m_appliedAuras.KeyValueList[i];
if (remove) if (remove)
{ {
remove = false; remove = false;
@@ -4195,7 +4194,7 @@ namespace Game.Entities
continue; continue;
RemoveAura(app, AuraRemoveMode.Default); RemoveAura(app, AuraRemoveMode.Default);
if (i == appliedAuraList.Count - 1) if (i == m_appliedAuras.KeyValueList.Count - 1)
break; break;
remove = true; remove = true;
+2 -2
View File
@@ -227,7 +227,7 @@ namespace Game.Entities
{ {
var seat = Seats.LookupByKey(seatId); var seat = Seats.LookupByKey(seatId);
if (seat == null) if (seat == null)
return seat; return null;
foreach (var sea in Seats) 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", 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); 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); Target.RemovePendingEvent(this);
// @SPELL_AURA_CONTROL_VEHICLE auras can be applied even when the passenger is not (yet) on the vehicle. // @SPELL_AURA_CONTROL_VEHICLE auras can be applied even when the passenger is not (yet) on the vehicle.
+3 -3
View File
@@ -726,7 +726,7 @@ namespace Game
do do
{ {
uint questId = result.Read<uint>(0); uint questId = result.Read<uint>(0);
ushort eventEntry = result.Read<byte>(1); /// @todo Change to byte ushort eventEntry = result.Read<byte>(1); // @todo Change to byte
if (Global.ObjectMgr.GetQuestTemplate(questId) == null) if (Global.ObjectMgr.GetQuestTemplate(questId) == null)
{ {
@@ -1214,10 +1214,10 @@ namespace Game
if (!map.Instanceable() && map.IsGridLoaded(data.posX, data.posY)) if (!map.Instanceable() && map.IsGridLoaded(data.posX, data.posY))
{ {
GameObject pGameobject = GameObject.CreateGameObjectFromDB(guid, map, false); 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) if (pGameobject)
{ {
/// @todo find out when it is add to map // @todo find out when it is add to map
if (pGameobject.isSpawnedByDefault()) if (pGameobject.isSpawnedByDefault())
map.AddToMap(pGameobject); map.AddToMap(pGameobject);
} }
+1
View File
@@ -4561,6 +4561,7 @@ namespace Game
ItemTemplateStorage.Add(sparse.Id, itemTemplate); ItemTemplateStorage.Add(sparse.Id, itemTemplate);
} }
// Load item effects (spells)
foreach (var effectEntry in CliDB.ItemEffectStorage.Values) foreach (var effectEntry in CliDB.ItemEffectStorage.Values)
{ {
var itemTemplate = ItemTemplateStorage.LookupByKey(effectEntry.ParentItemID); var itemTemplate = ItemTemplateStorage.LookupByKey(effectEntry.ParentItemID);
+2 -2
View File
@@ -939,7 +939,7 @@ namespace Game.Guilds
GuildChallengeUpdate updatePacket = new GuildChallengeUpdate(); GuildChallengeUpdate updatePacket = new GuildChallengeUpdate();
for (int i = 0; i < GuildConst.ChallengesTypes; ++i) 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) for (int i = 0; i < GuildConst.ChallengesTypes; ++i)
updatePacket.MaxCount[i] = GuildConst.ChallengesMaxCount[i]; updatePacket.MaxCount[i] = GuildConst.ChallengesMaxCount[i];
@@ -3697,7 +3697,7 @@ namespace Game.Guilds
public override void LogAction(MoveItemData pFrom) public override void LogAction(MoveItemData pFrom)
{ {
base.LogAction(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})", 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(), m_pPlayer.GetName(), m_pPlayer.GetGUID().ToString(), m_pPlayer.GetSession().GetAccountId(), pFrom.GetItem().GetTemplate().GetName(),
+1 -1
View File
@@ -231,7 +231,7 @@ namespace Game
SQLTransaction trans; SQLTransaction trans;
if (WorldConfig.GetBoolValue(WorldCfg.AllowTwoSideInteractionAuction)) 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 else
AH.auctioneer = creature.GetSpawnId(); AH.auctioneer = creature.GetSpawnId();
@@ -81,7 +81,7 @@ namespace Game
public void SendSetTimeZoneInformation() public void SendSetTimeZoneInformation()
{ {
/// @todo: replace dummy values // @todo: replace dummy values
SetTimeZoneInformation packet = new SetTimeZoneInformation(); SetTimeZoneInformation packet = new SetTimeZoneInformation();
packet.ServerTimeTZ = "Europe/Paris"; packet.ServerTimeTZ = "Europe/Paris";
packet.GameTimeTZ = "Europe/Paris"; packet.GameTimeTZ = "Europe/Paris";
+2 -2
View File
@@ -591,8 +591,8 @@ namespace Game
[WorldPacketHandler(ClientOpcodes.RequestRatedBattlefieldInfo)] [WorldPacketHandler(ClientOpcodes.RequestRatedBattlefieldInfo)]
void HandleRequestRatedBattlefieldInfo(RequestRatedBattlefieldInfo packet) void HandleRequestRatedBattlefieldInfo(RequestRatedBattlefieldInfo packet)
{ {
/// @Todo: perfome research in this case // @Todo: perfome research in this case
/// The unk fields are related to arenas // The unk fields are related to arenas
WorldPacket data = new WorldPacket(ServerOpcodes.RatedBattlefieldInfo); WorldPacket data = new WorldPacket(ServerOpcodes.RatedBattlefieldInfo);
data.WriteInt32(0); // BgWeeklyWins20vs20 data.WriteInt32(0); // BgWeeklyWins20vs20
data.WriteInt32(0); // BgWeeklyPlayed20vs20 data.WriteInt32(0); // BgWeeklyPlayed20vs20
+1 -1
View File
@@ -208,7 +208,7 @@ namespace Game
return; return;
CalendarEvent oldEvent = Global.CalendarMgr.GetEvent(calendarCopyEvent.EventID); CalendarEvent oldEvent = Global.CalendarMgr.GetEvent(calendarCopyEvent.EventID);
if (oldEvent == null) if (oldEvent != null)
{ {
CalendarEvent newEvent = new CalendarEvent(oldEvent, Global.CalendarMgr.GetFreeEventId()); CalendarEvent newEvent = new CalendarEvent(oldEvent, Global.CalendarMgr.GetFreeEventId());
newEvent.Date = calendarCopyEvent.Date; newEvent.Date = calendarCopyEvent.Date;
+17 -17
View File
@@ -132,7 +132,7 @@ namespace Game
[WorldPacketHandler(ClientOpcodes.EnumCharactersDeletedByClient, Status = SessionStatus.Authed)] [WorldPacketHandler(ClientOpcodes.EnumCharactersDeletedByClient, Status = SessionStatus.Authed)]
void HandleCharUndeleteEnum(EnumCharacters enumCharacters) 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; PreparedStatement stmt;
if (WorldConfig.GetBoolValue(WorldCfg.DeclinedNamesUsed)) if (WorldConfig.GetBoolValue(WorldCfg.DeclinedNamesUsed))
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_UNDELETE_ENUM_DECLINED_NAME); stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_UNDELETE_ENUM_DECLINED_NAME);
@@ -379,7 +379,7 @@ namespace Game
} }
// need to check team only for first character // 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) if (!allowTwoSideAccounts)
{ {
Team accTeam = 0; Team accTeam = 0;
@@ -866,7 +866,7 @@ namespace Game
{ {
FeatureSystemStatus features = new FeatureSystemStatus(); FeatureSystemStatus features = new FeatureSystemStatus();
/// START OF DUMMY VALUES // START OF DUMMY VALUES
features.ComplaintStatus = 2; features.ComplaintStatus = 2;
features.ScrollOfResurrectionRequestsRemaining = 1; features.ScrollOfResurrectionRequestsRemaining = 1;
features.ScrollOfResurrectionMaxRequestsPerDay = 1; features.ScrollOfResurrectionMaxRequestsPerDay = 1;
@@ -887,7 +887,7 @@ namespace Game
features.ComplaintStatus = 0; features.ComplaintStatus = 0;
features.TutorialsEnabled = true; features.TutorialsEnabled = true;
features.NPETutorialsEnabled = true; features.NPETutorialsEnabled = true;
/// END OF DUMMY VALUES // END OF DUMMY VALUES
features.EuropaTicketSystemStatus.Value.TicketsEnabled = WorldConfig.GetBoolValue(WorldCfg.SupportTicketsEnabled); features.EuropaTicketSystemStatus.Value.TicketsEnabled = WorldConfig.GetBoolValue(WorldCfg.SupportTicketsEnabled);
features.EuropaTicketSystemStatus.Value.BugsEnabled = WorldConfig.GetBoolValue(WorldCfg.SupportBugsEnabled); features.EuropaTicketSystemStatus.Value.BugsEnabled = WorldConfig.GetBoolValue(WorldCfg.SupportBugsEnabled);
@@ -1246,7 +1246,7 @@ namespace Game
} }
// character with this name already exist // character with this name already exist
/// @todo: make async // @todo: make async
ObjectGuid newGuid = ObjectManager.GetPlayerGUIDByName(customizeInfo.CharName); ObjectGuid newGuid = ObjectManager.GetPlayerGUIDByName(customizeInfo.CharName);
if (!newGuid.IsEmpty()) if (!newGuid.IsEmpty())
{ {
@@ -1261,7 +1261,7 @@ namespace Game
SQLTransaction trans = new SQLTransaction(); SQLTransaction trans = new SQLTransaction();
ulong lowGuid = customizeInfo.CharGUID.GetCounter(); ulong lowGuid = customizeInfo.CharGUID.GetCounter();
/// Customize // Customize
{ {
stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_GENDER_AND_APPEARANCE); stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_GENDER_AND_APPEARANCE);
@@ -1279,7 +1279,7 @@ namespace Game
trans.Append(stmt); 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 = DB.Characters.GetPreparedStatement(CharStatements.UPD_CHAR_NAME_AT_LOGIN);
stmt.AddValue(0, customizeInfo.CharName); stmt.AddValue(0, customizeInfo.CharName);
@@ -1325,11 +1325,11 @@ namespace Game
{ {
Item item = _player.GetItemByPos(InventorySlots.Bag0, i); 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) if (!item)
return; 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) if (item.GetGUID() != itemGuid)
return; return;
} }
@@ -1358,7 +1358,7 @@ namespace Game
saveEquipmentSet.Set.Appearances[i] = 0; 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) if (saveEquipmentSet.Set.Type == EquipmentSetInfo.EquipmentSetType.Equipment)
{ {
saveEquipmentSet.Set.Enchants[0] = 0; saveEquipmentSet.Set.Enchants[0] = 0;
@@ -1583,7 +1583,7 @@ namespace Game
// resurrect the character in case he's dead // resurrect the character in case he's dead
Player.OfflineResurrect(factionChangeInfo.Guid, trans); 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 = DB.Characters.GetPreparedStatement(CharStatements.UPD_CHAR_NAME_AT_LOGIN);
stmt.AddValue(0, factionChangeInfo.Name); stmt.AddValue(0, factionChangeInfo.Name);
@@ -1719,7 +1719,7 @@ namespace Game
trans.Append(stmt); trans.Append(stmt);
} }
/// @todo: make this part asynch // @todo: make this part asynch
if (!WorldConfig.GetBoolValue(WorldCfg.AllowTwoSideInteractionGuild)) if (!WorldConfig.GetBoolValue(WorldCfg.AllowTwoSideInteractionGuild))
{ {
// Reset guild // Reset guild
@@ -2092,11 +2092,11 @@ namespace Game
return; return;
} }
/// @todo: add more safety checks // @todo: add more safety checks
/// * max char count per account // * max char count per account
/// * max death knight count // * max death knight count
/// * max demon hunter count // * max demon hunter count
/// * team violation // * team violation
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_SUM_CHARS); stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_SUM_CHARS);
stmt.AddValue(0, GetAccountId()); stmt.AddValue(0, GetAccountId());
+1 -1
View File
@@ -448,7 +448,7 @@ namespace Game
} }
break; break;
case ChatMsg.Whisper: case ChatMsg.Whisper:
/// @todo implement cross realm whispers (someday) // @todo implement cross realm whispers (someday)
ExtendedPlayerName extName = ObjectManager.ExtractExtendedPlayerName(target); ExtendedPlayerName extName = ObjectManager.ExtractExtendedPlayerName(target);
if (!ObjectManager.NormalizePlayerName(ref extName.Name)) if (!ObjectManager.NormalizePlayerName(ref extName.Name))
+3 -3
View File
@@ -102,7 +102,7 @@ namespace Game
honorStats.LifetimeHK = player.GetUInt32Value(PlayerFields.LifetimeHonorableKills); honorStats.LifetimeHK = player.GetUInt32Value(PlayerFields.LifetimeHonorableKills);
honorStats.YesterdayHK = player.GetUInt16Value(PlayerFields.Kills, 1); honorStats.YesterdayHK = player.GetUInt16Value(PlayerFields.Kills, 1);
honorStats.TodayHK = player.GetUInt16Value(PlayerFields.Kills, 0); honorStats.TodayHK = player.GetUInt16Value(PlayerFields.Kills, 0);
honorStats.LifetimeMaxRank = 0; /// @todo honorStats.LifetimeMaxRank = 0; // @todo
SendPacket(honorStats); SendPacket(honorStats);
} }
@@ -110,7 +110,7 @@ namespace Game
[WorldPacketHandler(ClientOpcodes.InspectPvp)] [WorldPacketHandler(ClientOpcodes.InspectPvp)]
void HandleInspectPVP(InspectPVPRequest request) void HandleInspectPVP(InspectPVPRequest request)
{ {
/// @todo: deal with request.InspectRealmAddress // @todo: deal with request.InspectRealmAddress
Player player = Global.ObjAccessor.FindPlayer(request.InspectTarget); Player player = Global.ObjAccessor.FindPlayer(request.InspectTarget);
if (!player) if (!player)
@@ -127,7 +127,7 @@ namespace Game
InspectPVPResponse response = new InspectPVPResponse(); InspectPVPResponse response = new InspectPVPResponse();
response.ClientGUID = request.InspectTarget; response.ClientGUID = request.InspectTarget;
/// @todo: fill brackets // @todo: fill brackets
SendPacket(response); SendPacket(response);
} }
+1 -1
View File
@@ -359,7 +359,7 @@ namespace Game
} }
else else
{ {
/// @todo: 6.x research new values // @todo: 6.x research new values
/*WorldPackets.Item.ReadItemResultFailed packet; /*WorldPackets.Item.ReadItemResultFailed packet;
packet.Item = item->GetGUID(); packet.Item = item->GetGUID();
packet.Subcode = ??; packet.Subcode = ??;
+1 -1
View File
@@ -37,7 +37,7 @@ namespace Game
Player player = GetPlayer(); Player player = GetPlayer();
AELootResult aeResult = player.GetAELootView().Count > 1 ? new AELootResult() : null; 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) foreach (LootRequest req in packet.Loot)
{ {
Loot loot = null; Loot loot = null;
+1 -1
View File
@@ -186,7 +186,7 @@ namespace Game
{ {
// NOTE: this is actually called many times while falling // NOTE: this is actually called many times while falling
// even after the player has been teleported away // 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()) if (plrMover.IsAlive())
{ {
plrMover.SetFlag(PlayerFields.Flags, PlayerFlags.IsOutOfBounds); plrMover.SetFlag(PlayerFields.Flags, PlayerFlags.IsOutOfBounds);
+3 -3
View File
@@ -83,7 +83,7 @@ namespace Game
return; return;
} }
/// @todo allow control charmed player? // @todo allow control charmed player?
if (pet.IsTypeId(TypeId.Player) && !(flag == ActiveStates.Command && spellid == (uint)CommandStates.Attack)) if (pet.IsTypeId(TypeId.Player) && !(flag == ActiveStates.Command && spellid == (uint)CommandStates.Attack))
return; return;
@@ -169,7 +169,7 @@ namespace Game
// Can't attack if owner is pacified // Can't attack if owner is pacified
if (GetPlayer().HasAuraType(AuraType.ModPacify)) if (GetPlayer().HasAuraType(AuraType.ModPacify))
{ {
/// @todo Send proper error message to client // @todo Send proper error message to client
return; return;
} }
@@ -376,7 +376,7 @@ namespace Game
} }
else 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); Spell.SendCastResult(GetPlayer(), spellInfo, spell.m_SpellVisual, spell.m_castId, result);
else else
spell.SendPetCastResult(result); spell.SendPetCastResult(result);
+2 -2
View File
@@ -471,7 +471,7 @@ namespace Game
if (!GetPlayer().IsInSameRaidWith(originalPlayer)) if (!GetPlayer().IsInSameRaidWith(originalPlayer))
return; return;
if (!!originalPlayer.IsActiveQuest(packet.QuestID)) if (!originalPlayer.IsActiveQuest(packet.QuestID))
return; return;
if (!GetPlayer().CanTakeQuest(quest, true)) if (!GetPlayer().CanTakeQuest(quest, true))
@@ -646,7 +646,7 @@ namespace Game
{ {
WorldQuestUpdate response = new WorldQuestUpdate(); 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)); //response.WorldQuestUpdates.push_back(WorldPackets::Quest::WorldQuestUpdateInfo(lastUpdate, questID, timer, variableID, value));
SendPacket(response); SendPacket(response);
+11 -11
View File
@@ -44,17 +44,17 @@ namespace Game
if (request.Words.Count > 4) if (request.Words.Count > 4)
return; return;
/// @todo: handle following packet values // @todo: handle following packet values
/// VirtualRealmNames // VirtualRealmNames
/// ShowEnemies // ShowEnemies
/// ShowArenaPlayers // ShowArenaPlayers
/// ExactName // ExactName
/// ServerInfo // ServerInfo
request.Words.ForEach(p => p = p.ToLower()); request.Words.ForEach(p => p = p.ToLower());
request.Name.ToLower(); request.Name = request.Name.ToLower();
request.Guild.ToLower(); request.Guild = request.Guild.ToLower();
// client send in case not set max level value 100 but we support 255 max level, // 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 // update it to show GMs with characters after 100 level
@@ -282,7 +282,7 @@ namespace Game
[WorldPacketHandler(ClientOpcodes.DelFriend)] [WorldPacketHandler(ClientOpcodes.DelFriend)]
void HandleDelFriend(DelFriend packet) void HandleDelFriend(DelFriend packet)
{ {
/// @todo: handle VirtualRealmAddress // @todo: handle VirtualRealmAddress
GetPlayer().GetSocial().RemoveFromSocialList(packet.Player.Guid, SocialFlag.Friend); GetPlayer().GetSocial().RemoveFromSocialList(packet.Player.Guid, SocialFlag.Friend);
Global.SocialMgr.SendFriendStatus(GetPlayer(), FriendsResult.Removed, packet.Player.Guid); Global.SocialMgr.SendFriendStatus(GetPlayer(), FriendsResult.Removed, packet.Player.Guid);
@@ -336,7 +336,7 @@ namespace Game
[WorldPacketHandler(ClientOpcodes.DelIgnore)] [WorldPacketHandler(ClientOpcodes.DelIgnore)]
void HandleDelIgnore(DelIgnore packet) void HandleDelIgnore(DelIgnore packet)
{ {
/// @todo: handle VirtualRealmAddress // @todo: handle VirtualRealmAddress
Log.outDebug(LogFilter.Network, "WorldSession.HandleDelIgnoreOpcode: {0}", packet.Player.Guid.ToString()); Log.outDebug(LogFilter.Network, "WorldSession.HandleDelIgnoreOpcode: {0}", packet.Player.Guid.ToString());
GetPlayer().GetSocial().RemoveFromSocialList(packet.Player.Guid, SocialFlag.Ignored); GetPlayer().GetSocial().RemoveFromSocialList(packet.Player.Guid, SocialFlag.Ignored);
@@ -347,7 +347,7 @@ namespace Game
[WorldPacketHandler(ClientOpcodes.SetContactNotes)] [WorldPacketHandler(ClientOpcodes.SetContactNotes)]
void HandleSetContactNotes(SetContactNotes packet) 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); Log.outDebug(LogFilter.Network, "WorldSession.HandleSetContactNotesOpcode: Contact: {0}, Notes: {1}", packet.Player.Guid.ToString(), packet.Notes);
GetPlayer().GetSocial().SetFriendNote(packet.Player.Guid, packet.Notes); GetPlayer().GetSocial().SetFriendNote(packet.Player.Guid, packet.Notes);
} }
+1 -1
View File
@@ -469,7 +469,7 @@ namespace Game
if (unit == null) if (unit == null)
return; 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) if (!unit.IsInWorld)
return; return;
+2 -2
View File
@@ -28,7 +28,7 @@ namespace Game
{ {
UpdateListedAuctionableTokensResponse response = new UpdateListedAuctionableTokensResponse(); UpdateListedAuctionableTokensResponse response = new UpdateListedAuctionableTokensResponse();
/// @todo: fix 6.x implementation // @todo: fix 6.x implementation
response.UnkInt = updateListedAuctionableTokens.UnkInt; response.UnkInt = updateListedAuctionableTokens.UnkInt;
response.Result = TokenResult.Success; response.Result = TokenResult.Success;
@@ -40,7 +40,7 @@ namespace Game
{ {
WowTokenMarketPriceResponse response = new WowTokenMarketPriceResponse(); WowTokenMarketPriceResponse response = new WowTokenMarketPriceResponse();
/// @todo: 6.x fix implementation // @todo: 6.x fix implementation
response.CurrentMarketPrice = 300000000; response.CurrentMarketPrice = 300000000;
response.UnkInt = requestWowTokenMarketPrice.UnkInt; response.UnkInt = requestWowTokenMarketPrice.UnkInt;
response.Result = TokenResult.Success; response.Result = TokenResult.Success;
+2 -2
View File
@@ -841,7 +841,7 @@ namespace Game.Loots
foreach (var group in Groups) foreach (var group in Groups)
group.Value.Verify(lootstore, id, (byte)(group.Key + 1)); group.Value.Verify(lootstore, id, (byte)(group.Key + 1));
/// @todo References validity checks // @todo References validity checks
} }
public void CheckLootRefs(LootTemplateMap store, List<uint> ref_set) public void CheckLootRefs(LootTemplateMap store, List<uint> ref_set)
{ {
@@ -992,7 +992,7 @@ namespace Game.Loots
public void Verify(LootStore lootstore, uint id, byte group_id = 0) public void Verify(LootStore lootstore, uint id, byte group_id = 0)
{ {
float chance = RawTotalChance(); 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); 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()) if (chance >= 100.0f && !EqualChanced.Empty())
+5 -5
View File
@@ -338,7 +338,7 @@ namespace Game.Maps
void DeleteFromWorld(Player player) void DeleteFromWorld(Player player)
{ {
Global.ObjAccessor.RemoveObject(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(); 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 //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 //To avoid this, we can load nearby cells when player log in
//But this check is always needed to ensure safety //But this check is always needed to ensure safety
/// @todo pets will disappear if this is outside CreatureRespawnRelocation // @todo pets will disappear if this is outside CreatureRespawnRelocation
/// //need to check why pet is frequently relocated to an unloaded cell //need to check why pet is frequently relocated to an unloaded cell
if (creature.IsPet()) if (creature.IsPet())
((Pet)creature).Remove(PetSaveMode.NotInSlot, true); ((Pet)creature).Remove(PetSaveMode.NotInSlot, true);
else else
@@ -4434,7 +4434,7 @@ namespace Game.Maps
public override bool AddPlayerToMap(Player player, bool initPlayer = true) 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. // GMs still can teleport player in instance.
// Is it needed? // Is it needed?
lock(_mapLock) lock(_mapLock)
@@ -4623,7 +4623,7 @@ namespace Game.Maps
if (load) if (load)
{ {
/// @todo make a global storage for this // @todo make a global storage for this
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_INSTANCE); PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_INSTANCE);
stmt.AddValue(0, GetId()); stmt.AddValue(0, GetId());
stmt.AddValue(1, i_InstanceId); stmt.AddValue(1, i_InstanceId);
@@ -255,7 +255,7 @@ namespace Game.Movement
} }
// look for startPoly/endPoly in current path // 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 startPolyFound = false;
bool endPolyFound = false; bool endPolyFound = false;
uint pathStartIndex = 0; uint pathStartIndex = 0;
@@ -314,7 +314,7 @@ namespace Game.Movement
// sub-path of optimal path is optimal // sub-path of optimal path is optimal
// take ~80% of the original length // 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); uint prefixPolyLength = (uint)(_polyLength * 0.8f + 0.5f);
Array.Copy(_pathPolyRefs, pathStartIndex, _pathPolyRefs, 0, prefixPolyLength); 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 // only happens if pass bad data to findStraightPath or navmesh is broken
// single point paths can be generated here // 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); Log.outDebug(LogFilter.Maps, "++ PathGenerator.BuildPointPath FAILED! path sized {0} returned\n", pointCount);
BuildShortcut(); BuildShortcut();
pathType = PathType.NoPath; pathType = PathType.NoPath;
@@ -921,9 +921,9 @@ namespace Game.Movement
_navMesh.calcTileLoc(point, ref tx, ref ty); _navMesh.calcTileLoc(point, ref tx, ref ty);
/// Workaround // Workaround
/// For some reason, often the tx and ty variables wont get a valid value // 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 // Use this check to prevent getting negative tile coords and crashing on getTileAt
if (tx < 0 || ty < 0) if (tx < 0 || ty < 0)
return false; return false;
+2 -2
View File
@@ -54,7 +54,7 @@ namespace Game.Movement
// Returns true to show that the arguments were configured correctly and MoveSpline initialization will succeed. // Returns true to show that the arguments were configured correctly and MoveSpline initialization will succeed.
public bool Validate(Unit unit) public bool Validate(Unit unit)
{ {
Func<bool, bool> CHECK = new Func<bool, bool>(exp => Func<bool, bool> CHECK = exp =>
{ {
if (!(exp)) if (!(exp))
{ {
@@ -62,7 +62,7 @@ namespace Game.Movement
return false; return false;
} }
return true; return true;
}); };
if (!CHECK(path.Length > 1)) if (!CHECK(path.Length > 1))
return false; return false;
@@ -139,8 +139,8 @@ namespace Game.Network.Packets
foreach (var klass in SuccessInfo.Value.AvailableClasses) foreach (var klass in SuccessInfo.Value.AvailableClasses)
{ {
_worldPacket.WriteUInt8(klass.Key); /// the current class _worldPacket.WriteUInt8(klass.Key); // the current class
_worldPacket.WriteUInt8(klass.Value); /// the required Expansion _worldPacket.WriteUInt8(klass.Value); // the required Expansion
} }
_worldPacket.WriteBit(SuccessInfo.Value.IsExpansionTrial); _worldPacket.WriteBit(SuccessInfo.Value.IsExpansionTrial);
@@ -63,7 +63,7 @@ namespace Game.Network.Packets
public bool Success; public bool Success;
public bool IsDeletedCharacters; // used for character undelete list 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 HasDemonHunterOnRealm = false;
public bool Unknown7x = false; public bool Unknown7x = false;
public bool IsAlliedRacesCreationAllowed = false; public bool IsAlliedRacesCreationAllowed = false;
@@ -72,7 +72,7 @@ namespace Game.Network.Packets
public Optional<uint> DisabledClassesMask = new Optional<uint>(); public Optional<uint> DisabledClassesMask = new Optional<uint>();
public List<CharacterInfo> Characters = new List<CharacterInfo>(); // all characters on the list public List<CharacterInfo> Characters = new List<CharacterInfo>(); // all characters on the list
public List<RaceUnlock> RaceUnlockData = new List<RaceUnlock>(); ///< public List<RaceUnlock> RaceUnlockData = new List<RaceUnlock>(); //
public class CharacterInfo public class CharacterInfo
{ {
+2 -2
View File
@@ -716,7 +716,7 @@ namespace Game.Network.Packets
} }
public ObjectGuid NoteeGUID; public ObjectGuid NoteeGUID;
public bool IsPublic; ///< 0 == Officer, 1 == Public public bool IsPublic; // 0 == Officer, 1 == Public
public string Note; public string Note;
} }
@@ -736,7 +736,7 @@ namespace Game.Network.Packets
} }
public ObjectGuid Member; public ObjectGuid Member;
public bool IsPublic; ///< 0 == Officer, 1 == Public public bool IsPublic; // 0 == Officer, 1 == Public
public string Note; public string Note;
} }
@@ -98,8 +98,8 @@ namespace Game.Network.Packets
{ {
_worldPacket.WritePackedGuid(PlayerGUID); _worldPacket.WritePackedGuid(PlayerGUID);
_worldPacket.WriteUInt8(LifetimeMaxRank); _worldPacket.WriteUInt8(LifetimeMaxRank);
_worldPacket.WriteUInt16(YesterdayHK); /// @todo: confirm order _worldPacket.WriteUInt16(YesterdayHK); // @todo: confirm order
_worldPacket.WriteUInt16(TodayHK); /// @todo: confirm order _worldPacket.WriteUInt16(TodayHK); // @todo: confirm order
_worldPacket.WriteUInt32(LifetimeHK); _worldPacket.WriteUInt32(LifetimeHK);
} }
@@ -184,7 +184,7 @@ namespace Game.Network.Packets
Item = new ItemInstance(item); Item = new ItemInstance(item);
Index = index; Index = index;
Usable = true; /// @todo Usable = true; // @todo
for (EnchantmentSlot enchant = 0; enchant < EnchantmentSlot.Max; ++enchant) for (EnchantmentSlot enchant = 0; enchant < EnchantmentSlot.Max; ++enchant)
{ {
+2 -2
View File
@@ -305,8 +305,8 @@ namespace Game.Network.Packets
} }
public InvUpdate Inv; public InvUpdate Inv;
public byte Slot1; /// Source Slot public byte Slot1; // Source Slot
public byte Slot2; /// Destination Slot public byte Slot2; // Destination Slot
} }
public class SwapItem : ClientPacket public class SwapItem : ClientPacket
@@ -41,7 +41,7 @@ namespace Game.Network.Packets
} }
public int[] FactionStandings = new int[FactionCount]; 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]; public FactionFlags[] FactionFlags = new FactionFlags[FactionCount];
} }
+1 -1
View File
@@ -209,7 +209,7 @@ namespace Game
{ {
initFactions.FactionFlags[pair.Key] = pair.Value.Flags; initFactions.FactionFlags[pair.Key] = pair.Value.Flags;
initFactions.FactionStandings[pair.Key] = pair.Value.Standing; initFactions.FactionStandings[pair.Key] = pair.Value.Standing;
/// @todo faction bonus // @todo faction bonus
pair.Value.needSend = false; pair.Value.needSend = false;
} }
+5 -5
View File
@@ -859,7 +859,7 @@ namespace Game
//to set mailtimer to return mails every day between 4 and 5 am //to set mailtimer to return mails every day between 4 and 5 am
//mailtimer is increased when updating auctions //mailtimer is increased when updating auctions
//one second is 1000 -(tested on win system) //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(); var localTime = Time.UnixTimeToDateTime(m_gameTime).ToLocalTime();
mail_timer = ((((localTime.Hour + 20) % 24) * Time.Hour * Time.InMilliseconds) / m_timers[WorldTimers.Auctions].GetInterval()); mail_timer = ((((localTime.Hour + 20) % 24) * Time.Hour * Time.InMilliseconds) / m_timers[WorldTimers.Auctions].GetInterval());
//1440 //1440
@@ -1212,7 +1212,7 @@ namespace Game
{ {
m_timers[WorldTimers.Blackmarket].Reset(); 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) if ((blackmarket_timer * m_timers[WorldTimers.Blackmarket].GetInterval() >= WorldConfig.GetIntValue(WorldCfg.BlackmarketUpdatePeriod) * Time.Hour * Time.InMilliseconds) || blackmarket_timer == 0)
{ {
Global.BlackMarketMgr.RefreshAuctions(); Global.BlackMarketMgr.RefreshAuctions();
@@ -1230,7 +1230,7 @@ namespace Game
UpdateSessions(diff); UpdateSessions(diff);
RecordTimeDiff("UpdateSessions"); RecordTimeDiff("UpdateSessions");
/// <li> Update uptime table // <li> Update uptime table
if (m_timers[WorldTimers.UpTime].Passed()) if (m_timers[WorldTimers.UpTime].Passed())
{ {
uint tmpDiff = (uint)(m_gameTime - m_startTime); uint tmpDiff = (uint)(m_gameTime - m_startTime);
@@ -1248,7 +1248,7 @@ namespace Game
DB.Login.Execute(stmt); DB.Login.Execute(stmt);
} }
/// <li> Clean logs table // <li> Clean logs table
if (WorldConfig.GetIntValue(WorldCfg.LogdbCleartime) > 0) // if not enabled, ignore the timer if (WorldConfig.GetIntValue(WorldCfg.LogdbCleartime) > 0) // if not enabled, ignore the timer
{ {
if (m_timers[WorldTimers.CleanDB].Passed()) if (m_timers[WorldTimers.CleanDB].Passed())
@@ -1580,7 +1580,7 @@ namespace Game
uint duration_secs = Time.TimeStringToSecs(duration); uint duration_secs = Time.TimeStringToSecs(duration);
/// Pick a player to ban if not online // Pick a player to ban if not online
if (!pBanned) if (!pBanned)
{ {
guid = ObjectManager.GetPlayerGUIDByName(name); guid = ObjectManager.GetPlayerGUIDByName(name);
+2 -2
View File
@@ -69,7 +69,7 @@ namespace Game
if (_player) if (_player)
LogoutPlayer(true); LogoutPlayer(true);
/// - If have unclosed socket, close it // - If have unclosed socket, close it
for (byte i = 0; i < 2; ++i) for (byte i = 0; i < 2; ++i)
{ {
if (m_Socket[i] != null) if (m_Socket[i] != null)
@@ -633,7 +633,7 @@ namespace Game
_accountLoginCallback = null; _accountLoginCallback = null;
} }
//! HandlePlayerLoginOpcode // HandlePlayerLoginOpcode
if (_charLoginCallback != null && _charLoginCallback.IsCompleted) if (_charLoginCallback != null && _charLoginCallback.IsCompleted)
{ {
HandlePlayerLogin((LoginQueryHolder)_charLoginCallback.Result); HandlePlayerLogin((LoginQueryHolder)_charLoginCallback.Result);
+6 -8
View File
@@ -388,7 +388,7 @@ namespace Game.Spells
var app = m_applications.LookupByKey(target.GetGUID()); var app = m_applications.LookupByKey(target.GetGUID());
/// @todo Figure out why this happens // @todo Figure out why this happens
if (app == null) if (app == null)
{ {
Log.outError(LogFilter.Spells, "Aura._UnapplyForTarget, target: {0}, caster: {1}, spell: {2} was not found in owners application map!", 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 // owner has to be in world, or effect has to be applied to self
if (!m_owner.IsSelfOrInSameMap(unit)) 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, 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, m_owner.GetName(), m_owner.IsInWorld ? (int)m_owner.GetMap().GetId() : -1,
unit.GetName(), unit.IsInWorld ? (int)unit.GetMap().GetId() : -1); unit.GetName(), unit.IsInWorld ? (int)unit.GetMap().GetId() : -1);
@@ -1706,7 +1706,7 @@ namespace Game.Spells
if (procEffectMask == 0) if (procEffectMask == 0)
return 0; return 0;
/// @todo // @todo
// do allow additional requirements for procs // 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 // 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) // 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 // Check if current equipment meets aura requirements
// do that only for passive spells // 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(); Unit target = aurApp.GetTarget();
if (IsPassive() && target.IsTypeId(TypeId.Player)) if (IsPassive() && target.IsTypeId(TypeId.Player))
{ {
@@ -2039,9 +2039,7 @@ namespace Game.Spells
if (eff.IsEffectAffected(m_spellInfo, aurEff.GetEffIndex())) if (eff.IsEffectAffected(m_spellInfo, aurEff.GetEffIndex()))
eff.Call(aurEff, dmgInfo, ref absorbAmount); eff.Call(aurEff, dmgInfo, ref absorbAmount);
if (!defaultPrevented) defaultPrevented = auraScript._IsDefaultActionPrevented();
defaultPrevented = auraScript._IsDefaultActionPrevented();
auraScript._FinishScriptCall(); 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) foreach (var auraScript in m_loadedScripts)
{ {
+3 -3
View File
@@ -1938,7 +1938,7 @@ namespace Game.Spells
Unit target = aurApp.GetTarget(); Unit target = aurApp.GetTarget();
// Vengeance of the Blue Flight (@todo REMOVE THIS!) // Vengeance of the Blue Flight (@todo REMOVE THIS!)
/// @workaround // @workaround
if (m_spellInfo.Id == 45839) if (m_spellInfo.Id == 45839)
{ {
if (apply) if (apply)
@@ -4985,7 +4985,7 @@ namespace Game.Spells
HealInfo healInfo = new HealInfo(caster, target, heal, auraSpellInfo, auraSpellInfo.GetSchoolMask()); HealInfo healInfo = new HealInfo(caster, target, heal, auraSpellInfo, auraSpellInfo.GetSchoolMask());
caster.HealBySpell(healInfo); caster.HealBySpell(healInfo);
/// @todo: should proc other auras? // @todo: should proc other auras?
int mana = caster.GetMaxPower(PowerType.Mana); int mana = caster.GetMaxPower(PowerType.Mana);
if (mana != 0) if (mana != 0)
{ {
@@ -5044,7 +5044,7 @@ namespace Game.Spells
triggerSpellId = 30571; triggerSpellId = 30571;
break; break;
// Doom // 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 // so instakill will be naturally done before trigger spell
case 31347: case 31347:
{ {
+5 -5
View File
@@ -778,7 +778,7 @@ namespace Game.Spells
SpellTargetPosition st = Global.SpellMgr.GetSpellTargetPosition(m_spellInfo.Id, effIndex); SpellTargetPosition st = Global.SpellMgr.GetSpellTargetPosition(m_spellInfo.Id, effIndex);
if (st != null) if (st != null)
{ {
/// @todo fix this check // @todo fix this check
if (m_spellInfo.HasEffect(SpellEffectName.TeleportUnits) || m_spellInfo.HasEffect(SpellEffectName.Bind)) 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); 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()) else if (st.target_mapId == m_caster.GetMapId())
@@ -1244,7 +1244,7 @@ namespace Game.Spells
void SelectEffectTypeImplicitTargets(uint effIndex) void SelectEffectTypeImplicitTargets(uint effIndex)
{ {
// special case for SPELL_EFFECT_SUMMON_RAF_FRIEND and SPELL_EFFECT_SUMMON_PLAYER // 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); SpellEffectInfo effect = GetEffect(effIndex);
if (effect == null) if (effect == null)
return; return;
@@ -1670,7 +1670,7 @@ namespace Game.Spells
if (m_spellInfo.Speed > 0.0f && m_caster != target) if (m_spellInfo.Speed > 0.0f && m_caster != target)
{ {
// calculate spell incoming interval // 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()); float dist = m_caster.GetDistance(target.GetPositionX(), target.GetPositionY(), target.GetPositionZ());
if (dist < 5.0f) if (dist < 5.0f)
@@ -2132,7 +2132,7 @@ namespace Game.Spells
else if (m_caster.IsFriendlyTo(unit)) else if (m_caster.IsFriendlyTo(unit))
{ {
// for delayed spells ignore negative spells (after duel end) for friendly targets // 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) // 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) if (m_spellInfo.Speed > 0.0f && unit.IsTypeId(TypeId.Player) && !m_spellInfo.IsPositive() && m_spellInfo.Id != 63881)
return SpellMissInfo.Evade; return SpellMissInfo.Evade;
@@ -4089,7 +4089,7 @@ namespace Game.Spells
resurrectRequest.SpellID = m_spellInfo.Id; 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.Sickness = !m_caster.IsTypeId(TypeId.Player); // "you'll be afflicted with resurrection sickness"
resurrectRequest.Name = sentName; resurrectRequest.Name = sentName;
-7
View File
@@ -972,12 +972,5 @@ namespace Game.Spells
public DateTime RechargeStart; public DateTime RechargeStart;
public DateTime RechargeEnd; public DateTime RechargeEnd;
} }
class CooldownDurations
{
public int Cooldown = -1;
public uint CategoryId = 0;
public int CategoryCooldown = -1;
}
} }
} }
+12 -3
View File
@@ -658,8 +658,8 @@ namespace Game.Entities
SpellInfo first = GetSpellInfo(pair.Key); SpellInfo first = GetSpellInfo(pair.Key);
SpellInfo next = GetSpellInfo(pair.Value); SpellInfo next = GetSpellInfo(pair.Value);
if (first == null || next != null) if (!mSpellChains.ContainsKey(pair.Key))
continue; mSpellChains[pair.Key] = new SpellChainNode();
mSpellChains[pair.Key].first = first; mSpellChains[pair.Key].first = first;
mSpellChains[pair.Key].prev = null; mSpellChains[pair.Key].prev = null;
@@ -668,6 +668,9 @@ namespace Game.Entities
mSpellChains[pair.Key].rank = 1; mSpellChains[pair.Key].rank = 1;
mSpellInfoMap[pair.Key].ChainEntry = mSpellChains[pair.Key]; 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].first = first;
mSpellChains[pair.Value].prev = first; mSpellChains[pair.Value].prev = first;
mSpellChains[pair.Value].next = null; mSpellChains[pair.Value].next = null;
@@ -684,8 +687,14 @@ namespace Game.Entities
if (last == null) if (last == null)
break; break;
if (!mSpellChains.ContainsKey(nextPair.Key))
mSpellChains[nextPair.Key] = new SpellChainNode();
mSpellChains[nextPair.Key].next = last; mSpellChains[nextPair.Key].next = last;
if (!mSpellChains.ContainsKey(nextPair.Value))
mSpellChains[nextPair.Value] = new SpellChainNode();
mSpellChains[nextPair.Value].first = first; mSpellChains[nextPair.Value].first = first;
mSpellChains[nextPair.Value].prev = prev; mSpellChains[nextPair.Value].prev = prev;
mSpellChains[nextPair.Value].next = null; mSpellChains[nextPair.Value].next = null;
@@ -2433,7 +2442,7 @@ namespace Game.Entities
break; break;
case 56606: // Ride Jokkum case 56606: // Ride Jokkum
case 61791: // Ride Vehicle (Yogg-Saron) 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; spellInfo.GetEffect(0).BasePoints = 1;
break; break;
case 59630: // Black Magic case 59630: // Black Magic
+1 -1
View File
@@ -314,7 +314,7 @@ namespace Game
// TIMING_CHECK // TIMING_CHECK
{ {
byte result = buff.ReadUInt8(); byte result = buff.ReadUInt8();
/// @todo test it. // @todo test it.
if (result == 0x00) if (result == 0x00)
{ {
Log.outWarn(LogFilter.Warden, "{0} failed timing check. Action: {1}", _session.GetPlayerInfo(), Penalty()); Log.outWarn(LogFilter.Warden, "{0} failed timing check. Action: {1}", _session.GetPlayerInfo(), Penalty());
+2 -2
View File
@@ -136,7 +136,7 @@ namespace Game
return false; return false;
} }
/// Weather statistics: // Weather statistics:
// 30% - no change // 30% - no change
// 30% - weather gets better (if not fine) or change weather type // 30% - weather gets better (if not fine) or change weather type
// 30% - weather worsens (if not fine) // 30% - weather worsens (if not fine)
@@ -178,7 +178,7 @@ namespace Game
if (m_type != WeatherType.Fine) if (m_type != WeatherType.Fine)
{ {
/// Radical change: // Radical change:
// if light . heavy // if light . heavy
// if medium . change weather type // if medium . change weather type
// if heavy . 50% light, 50% change weather type // if heavy . 50% light, 50% change weather type
@@ -318,7 +318,7 @@ namespace Scripts.EasternKingdoms.Karazhan
switch (m_uiOperaEvent) switch (m_uiOperaEvent)
{ {
/// @todo Set Object visibilities for Opera based on performance // @todo Set Object visibilities for Opera based on performance
case OperaEvents.Oz: case OperaEvents.Oz:
break; break;
+2 -2
View File
@@ -134,7 +134,7 @@ namespace Scripts.Kalimdor.ZoneAshenvale
if (quest.Id == QuestIds.FreedomToRuul) if (quest.Id == QuestIds.FreedomToRuul)
{ {
me.SetFaction(Misc.FactionQuest); 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); Talk(TextIds.SayMugStart1);
me.SetFaction(Misc.FactionQuest); me.SetFaction(Misc.FactionQuest);
base.Start(true, false, player.GetGUID()); Start(true, false, player.GetGUID());
} }
} }
@@ -86,7 +86,7 @@ namespace Scripts.Northrend.AzjolNerub.Ahnkahet.ElderNadox
_scheduler.Schedule(TimeSpan.FromSeconds(10), task => _scheduler.Schedule(TimeSpan.FromSeconds(10), task =>
{ {
/// @todo: summoned by egg // @todo: summoned by egg
DoCast(me, SpellIds.SummonSwarmers); DoCast(me, SpellIds.SummonSwarmers);
if (RandomHelper.URand(1, 3) == 3) // 33% chance of dialog if (RandomHelper.URand(1, 3) == 3) // 33% chance of dialog
Talk(TextIds.SayEggSac); Talk(TextIds.SayEggSac);
@@ -147,7 +147,7 @@ namespace Scripts.Northrend.AzjolNerub.Ahnkahet.ElderNadox
if (!GuardianSummoned && me.HealthBelowPct(50)) if (!GuardianSummoned && me.HealthBelowPct(50))
{ {
/// @todo: summoned by egg // @todo: summoned by egg
Talk(TextIds.EmoteHatches, me); Talk(TextIds.EmoteHatches, me);
DoCast(me, SpellIds.SummonSwarmGuard); DoCast(me, SpellIds.SummonSwarmGuard);
GuardianSummoned = true; GuardianSummoned = true;

Some files were not shown because too many files have changed in this diff Show More