MMaps Updates, Needs tested.
Port From (https://github.com/TrinityCore/TrinityCore)
This commit is contained in:
@@ -239,28 +239,28 @@ namespace Game.DataStorage
|
||||
|
||||
orbitInfo.StartDelay = circularMovementInfos.Read<uint>(1);
|
||||
orbitInfo.Radius = circularMovementInfos.Read<float>(2);
|
||||
if (!float.IsInfinity(orbitInfo.Radius))
|
||||
if (!float.IsFinite(orbitInfo.Radius))
|
||||
{
|
||||
Log.outError(LogFilter.Sql, $"Table `areatrigger_create_properties_orbit` has listed areatrigger (AreaTriggerCreatePropertiesId: {areaTriggerCreatePropertiesId}) with invalid Radius ({orbitInfo.Radius}), set to 0!");
|
||||
orbitInfo.Radius = 0.0f;
|
||||
}
|
||||
|
||||
orbitInfo.BlendFromRadius = circularMovementInfos.Read<float>(3);
|
||||
if (!float.IsInfinity(orbitInfo.BlendFromRadius))
|
||||
if (!float.IsFinite(orbitInfo.BlendFromRadius))
|
||||
{
|
||||
Log.outError(LogFilter.Sql, $"Table `areatrigger_create_properties_orbit` has listed areatrigger (AreaTriggerCreatePropertiesId: {areaTriggerCreatePropertiesId}) with invalid BlendFromRadius ({orbitInfo.BlendFromRadius}), set to 0!");
|
||||
orbitInfo.BlendFromRadius = 0.0f;
|
||||
}
|
||||
|
||||
orbitInfo.InitialAngle = circularMovementInfos.Read<float>(4);
|
||||
if (!float.IsInfinity(orbitInfo.InitialAngle))
|
||||
if (!float.IsFinite(orbitInfo.InitialAngle))
|
||||
{
|
||||
Log.outError(LogFilter.Sql, $"Table `areatrigger_create_properties_orbit` has listed areatrigger (AreaTriggerCreatePropertiesId: {areaTriggerCreatePropertiesId}) with invalid InitialAngle ({orbitInfo.InitialAngle}), set to 0!");
|
||||
orbitInfo.InitialAngle = 0.0f;
|
||||
}
|
||||
|
||||
orbitInfo.ZOffset = circularMovementInfos.Read<float>(5);
|
||||
if (!float.IsInfinity(orbitInfo.ZOffset))
|
||||
if (!float.IsFinite(orbitInfo.ZOffset))
|
||||
{
|
||||
Log.outError(LogFilter.Sql, $"Table `spell_areatrigger_circular` has listed areatrigger (MiscId: {areaTriggerCreatePropertiesId}) with invalid ZOffset ({orbitInfo.ZOffset}), set to 0!");
|
||||
orbitInfo.ZOffset = 0.0f;
|
||||
|
||||
@@ -3377,7 +3377,7 @@ namespace Game.Entities
|
||||
stmt.AddValue(0, GetGUID().GetCounter());
|
||||
characterTransaction.Append(stmt);
|
||||
|
||||
static float finiteAlways(float f) { return !float.IsInfinity(f) ? f : 0.0f; };
|
||||
static float finiteAlways(float f) { return !float.IsFinite(f) ? f : 0.0f; };
|
||||
|
||||
if (create)
|
||||
{
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace Game.Maps
|
||||
{
|
||||
public static bool IsValidMapCoord(float c)
|
||||
{
|
||||
return !float.IsInfinity(c) && (Math.Abs(c) <= (MapConst.MapHalfSize - 0.5f));
|
||||
return !float.IsFinite(c) && (Math.Abs(c) <= (MapConst.MapHalfSize - 0.5f));
|
||||
}
|
||||
|
||||
public static bool IsValidMapCoord(float x, float y)
|
||||
@@ -40,7 +40,7 @@ namespace Game.Maps
|
||||
|
||||
public static bool IsValidMapCoord(float x, float y, float z, float o)
|
||||
{
|
||||
return IsValidMapCoord(x, y, z) && !float.IsInfinity(o);
|
||||
return IsValidMapCoord(x, y, z) && float.IsFinite(o);
|
||||
}
|
||||
|
||||
public static bool IsValidMapCoord(uint mapid, float x, float y)
|
||||
|
||||
@@ -703,10 +703,14 @@ namespace Game.Movement
|
||||
ulong[] visited = new ulong[MAX_VISIT_POLY];
|
||||
|
||||
int nvisited = 0;
|
||||
_navMeshQuery.moveAlongSurface(polys[0], iterPos, moveTgt, _filter, result, visited, ref nvisited, MAX_VISIT_POLY);
|
||||
if (Detour.dtStatusFailed(_navMeshQuery.moveAlongSurface(polys[0], iterPos, moveTgt, _filter, result, visited, ref nvisited, MAX_VISIT_POLY)))
|
||||
return Detour.DT_FAILURE;
|
||||
|
||||
npolys = FixupCorridor(polys, npolys, 74, visited, nvisited);
|
||||
|
||||
_navMeshQuery.getPolyHeight(polys[0], result, ref result[1]);
|
||||
if (Detour.dtStatusFailed(_navMeshQuery.getPolyHeight(polys[0], result, ref result[1])))
|
||||
return Detour.DT_FAILURE;
|
||||
|
||||
result[1] += 0.5f;
|
||||
Detour.dtVcopy(iterPos, result);
|
||||
|
||||
@@ -752,7 +756,9 @@ namespace Game.Movement
|
||||
}
|
||||
// Move position at the other side of the off-mesh link.
|
||||
Detour.dtVcopy(iterPos, connectionEndPos);
|
||||
_navMeshQuery.getPolyHeight(polys[0], iterPos, ref iterPos[1]);
|
||||
if (Detour.dtStatusFailed(_navMeshQuery.getPolyHeight(polys[0], iterPos, ref iterPos[1])))
|
||||
return Detour.DT_FAILURE;
|
||||
|
||||
iterPos[1] += 0.5f;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user