Misc Fixes
This commit is contained in:
@@ -78,13 +78,13 @@ public static class MathFunctions
|
|||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
static double eps(double a, double b)
|
static double eps(float a, float b)
|
||||||
{
|
{
|
||||||
double aa = Math.Abs(a) + 1.0;
|
float aa = Math.Abs(a) + 1.0f;
|
||||||
if (double.IsPositiveInfinity(aa))
|
if (float.IsPositiveInfinity(aa))
|
||||||
return double.Epsilon;
|
return 0.00001f;
|
||||||
|
|
||||||
return double.Epsilon * aa;
|
return 0.00001f * aa;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static float lerp(float a, float b, float f)
|
public static float lerp(float a, float b, float f)
|
||||||
@@ -98,27 +98,27 @@ public static class MathFunctions
|
|||||||
}
|
}
|
||||||
|
|
||||||
#region Fuzzy
|
#region Fuzzy
|
||||||
public static bool fuzzyEq(double a, double b)
|
public static bool fuzzyEq(float a, float b)
|
||||||
{
|
{
|
||||||
return (a == b) || (Math.Abs(a - b) <= eps(a, b));
|
return (a == b) || (Math.Abs(a - b) <= eps(a, b));
|
||||||
}
|
}
|
||||||
public static bool fuzzyGt(double a, double b)
|
public static bool fuzzyGt(float a, float b)
|
||||||
{
|
{
|
||||||
return a > b + eps(a, b);
|
return a > b + eps(a, b);
|
||||||
}
|
}
|
||||||
public static bool fuzzyLt(double a, double b)
|
public static bool fuzzyLt(float a, float b)
|
||||||
{
|
{
|
||||||
return a < b - eps(a, b);
|
return a < b - eps(a, b);
|
||||||
}
|
}
|
||||||
public static bool fuzzyNe(double a, double b)
|
public static bool fuzzyNe(float a, float b)
|
||||||
{
|
{
|
||||||
return !fuzzyEq(a, b);
|
return !fuzzyEq(a, b);
|
||||||
}
|
}
|
||||||
public static bool fuzzyLe(double a, double b)
|
public static bool fuzzyLe(float a, float b)
|
||||||
{
|
{
|
||||||
return a < b + eps(a, b);
|
return a < b + eps(a, b);
|
||||||
}
|
}
|
||||||
public static bool fuzzyGe(double a, double b)
|
public static bool fuzzyGe(float a, float b)
|
||||||
{
|
{
|
||||||
return a > b - eps(a, b);
|
return a > b - eps(a, b);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,24 @@
|
|||||||
using System;
|
/*
|
||||||
using System.Collections.Generic;
|
* Copyright (C) 2012-2019 CypherCore <http://github.com/CypherCore>
|
||||||
using System.Text;
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
using Framework.Constants;
|
using Framework.Constants;
|
||||||
using Game.Entities;
|
using Game.Entities;
|
||||||
using Game.Guilds;
|
using Game.Guilds;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace Game.DataStorage
|
namespace Game.DataStorage
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2873,7 +2873,7 @@ namespace Game.Entities
|
|||||||
{
|
{
|
||||||
return GetCreatureTemplate().InhabitType.HasAnyFlag(InhabitType.Air);
|
return GetCreatureTemplate().InhabitType.HasAnyFlag(InhabitType.Air);
|
||||||
}
|
}
|
||||||
public bool IsDungeonBoss() { return (GetCreatureTemplate().FlagsExtra.HasAnyFlag(CreatureFlagsExtra.DungeonBoss); }
|
public bool IsDungeonBoss() { return (GetCreatureTemplate().FlagsExtra.HasAnyFlag(CreatureFlagsExtra.DungeonBoss)); }
|
||||||
|
|
||||||
public void SetReactState(ReactStates st)
|
public void SetReactState(ReactStates st)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -6585,7 +6585,7 @@ namespace Game.Entities
|
|||||||
m_AELootView[loot.GetGUID()] = guid;
|
m_AELootView[loot.GetGUID()] = guid;
|
||||||
|
|
||||||
if (loot_type == LootType.Corpse && !guid.IsItem())
|
if (loot_type == LootType.Corpse && !guid.IsItem())
|
||||||
SetUnitFlags(UnitFlags.Looting);
|
AddUnitFlag(UnitFlags.Looting);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
SendLootError(loot.GetGUID(), guid, LootError.DidntKill);
|
SendLootError(loot.GetGUID(), guid, LootError.DidntKill);
|
||||||
|
|||||||
@@ -4211,7 +4211,8 @@ namespace Game.Entities
|
|||||||
packet.PlayerGUID = GetGUID();
|
packet.PlayerGUID = GetGUID();
|
||||||
SendPacket(packet);
|
SendPacket(packet);
|
||||||
|
|
||||||
if (GetRace() == Race.NightElf)
|
// If the player has the Wisp racial then cast the Wisp aura on them
|
||||||
|
if (HasSpell(20585))
|
||||||
CastSpell(this, 20584, true);
|
CastSpell(this, 20584, true);
|
||||||
CastSpell(this, 8326, true);
|
CastSpell(this, 8326, true);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user