More Cleanups

This commit is contained in:
hondacrx
2021-06-08 12:56:09 -04:00
parent 302a1f293c
commit 52e43853fe
58 changed files with 223 additions and 257 deletions
+1 -1
View File
@@ -150,7 +150,7 @@ namespace Game.Entities
{
_charmspells[x].SetActionAndType(spellId, ActiveStates.Disabled);
ActiveStates newstate = ActiveStates.Passive;
ActiveStates newstate;
if (!spellInfo.IsAutocastable())
newstate = ActiveStates.Passive;
+4 -4
View File
@@ -1337,7 +1337,7 @@ namespace Game.Entities
// 1. > 2. > 3. > 4. > 5. > 6. > 7. > 8.
// MISS > DODGE > PARRY > GLANCING > BLOCK > CRIT > CRUSHING > HIT
int sum = 0, tmp = 0;
int sum = 0;
int roll = RandomHelper.IRand(0, 9999);
uint attackerLevel = GetLevelForTarget(victim);
@@ -1357,7 +1357,7 @@ namespace Game.Entities
}
// 1. MISS
tmp = miss_chance;
int tmp = miss_chance;
if (tmp > 0 && roll < (sum += tmp))
return MeleeHitOutcome.Miss;
@@ -1477,9 +1477,9 @@ namespace Game.Entities
if (minDamage > maxDamage)
{
minDamage = minDamage + maxDamage;
minDamage += maxDamage;
maxDamage = minDamage - maxDamage;
minDamage = minDamage - maxDamage;
minDamage -= maxDamage;
}
if (maxDamage == 0.0f)
-2
View File
@@ -84,7 +84,6 @@ namespace Game.Entities
//Spells
protected Dictionary<CurrentSpellTypes, Spell> m_currentSpells = new((int)CurrentSpellTypes.Max);
Dictionary<SpellValueMod, int> CustomSpellValueMod = new();
MultiMap<uint, uint>[] m_spellImmune = new MultiMap<uint, uint>[(int)SpellImmunity.Max];
SpellAuraInterruptFlags m_interruptMask;
SpellAuraInterruptFlags2 m_interruptMask2;
@@ -93,7 +92,6 @@ namespace Game.Entities
SpellHistory _spellHistory;
//Auras
List<AuraEffect> AuraEffectList = new();
MultiMap<AuraType, AuraEffect> m_modAuras = new();
List<Aura> m_removedAuras = new();
List<AuraApplication> m_interruptableAuras = new(); // auras which have interrupt mask applied on unit
+3 -4
View File
@@ -687,8 +687,8 @@ namespace Game.Entities
uint areaId = GetAreaId();
uint ridingSkill = 5000;
AreaMountFlags mountFlags = 0;
bool isSubmerged = false;
bool isInWater = false;
bool isSubmerged;
bool isInWater;
if (IsTypeId(TypeId.Player))
ridingSkill = ToPlayer().GetSkillValue(SkillType.Riding);
@@ -705,8 +705,7 @@ namespace Game.Entities
mountFlags = (AreaMountFlags)areaTable.MountFlags;
}
LiquidData liquid;
ZLiquidStatus liquidStatus = GetMap().GetLiquidStatus(GetPhaseShift(), GetPositionX(), GetPositionY(), GetPositionZ(), LiquidHeaderTypeFlags.AllLiquids, out liquid);
ZLiquidStatus liquidStatus = GetMap().GetLiquidStatus(GetPhaseShift(), GetPositionX(), GetPositionY(), GetPositionZ(), LiquidHeaderTypeFlags.AllLiquids, out _);
isSubmerged = liquidStatus.HasAnyFlag(ZLiquidStatus.UnderWater) || HasUnitMovementFlag(MovementFlag.Swimming);
isInWater = liquidStatus.HasAnyFlag(ZLiquidStatus.InWater | ZLiquidStatus.UnderWater);
+1 -1
View File
@@ -1371,7 +1371,7 @@ namespace Game.Entities
public bool IsVisible()
{
return (m_serverSideVisibility.GetValue(ServerSideVisibilityType.GM) > (uint)AccountTypes.Player) ? false : true;
return m_serverSideVisibility.GetValue(ServerSideVisibilityType.GM) <= (uint)AccountTypes.Player;
}
public void SetVisible(bool val)