Some cleanups. (might break build for scripts as they are a WIP)
This commit is contained in:
@@ -336,12 +336,12 @@ namespace Game.Spells
|
||||
m_castItemGuid = createInfo.CastItemGUID;
|
||||
m_castItemId = createInfo.CastItemId;
|
||||
m_castItemLevel = createInfo.CastItemLevel;
|
||||
m_spellVisual = new SpellCastVisual(createInfo.Caster ? createInfo.Caster.GetCastSpellXSpellVisualId(createInfo._spellInfo) : createInfo._spellInfo.GetSpellXSpellVisualId(), 0);
|
||||
m_spellVisual = new SpellCastVisual(createInfo.Caster != null ? createInfo.Caster.GetCastSpellXSpellVisualId(createInfo._spellInfo) : createInfo._spellInfo.GetSpellXSpellVisualId(), 0);
|
||||
m_applyTime = GameTime.GetGameTime();
|
||||
m_owner = createInfo._owner;
|
||||
m_timeCla = 0;
|
||||
m_updateTargetMapInterval = 0;
|
||||
m_casterLevel = createInfo.Caster ? createInfo.Caster.GetLevel() : m_spellInfo.SpellLevel;
|
||||
m_casterLevel = createInfo.Caster != null ? createInfo.Caster.GetLevel() : m_spellInfo.SpellLevel;
|
||||
m_procCharges = 0;
|
||||
m_stackAmount = 1;
|
||||
m_isRemoved = false;
|
||||
@@ -452,7 +452,7 @@ namespace Game.Spells
|
||||
if (app == null)
|
||||
{
|
||||
Log.outError(LogFilter.Spells, "Aura._UnapplyForTarget, target: {0}, caster: {1}, spell: {2} was not found in owners application map!",
|
||||
target.GetGUID().ToString(), caster ? caster.GetGUID().ToString() : "", auraApp.GetBase().GetSpellInfo().Id);
|
||||
target.GetGUID().ToString(), caster != null ? caster.GetGUID().ToString() : "", auraApp.GetBase().GetSpellInfo().Id);
|
||||
Cypher.Assert(false);
|
||||
}
|
||||
|
||||
@@ -773,10 +773,10 @@ namespace Game.Spells
|
||||
if (withMods)
|
||||
{
|
||||
Unit caster = GetCaster();
|
||||
if (caster)
|
||||
if (caster != null)
|
||||
{
|
||||
Player modOwner = caster.GetSpellModOwner();
|
||||
if (modOwner)
|
||||
if (modOwner != null)
|
||||
modOwner.ApplySpellMod(GetSpellInfo(), SpellModOp.Duration, ref duration);
|
||||
}
|
||||
}
|
||||
@@ -788,7 +788,7 @@ namespace Game.Spells
|
||||
public void RefreshDuration(bool withMods = false)
|
||||
{
|
||||
Unit caster = GetCaster();
|
||||
if (withMods && caster)
|
||||
if (withMods && caster != null)
|
||||
{
|
||||
int duration = m_spellInfo.GetMaxDuration();
|
||||
// Calculate duration of periodics affected by haste.
|
||||
@@ -872,7 +872,7 @@ namespace Game.Spells
|
||||
|
||||
// only units have events
|
||||
Unit owner = m_owner.ToUnit();
|
||||
if (!owner)
|
||||
if (owner == null)
|
||||
return;
|
||||
|
||||
m_dropEvent = new ChargeDropEvent(this, removeMode);
|
||||
@@ -1589,10 +1589,10 @@ namespace Game.Spells
|
||||
if (HasEffectType(AuraType.ControlVehicle) && existingAura.HasEffectType(AuraType.ControlVehicle))
|
||||
{
|
||||
Vehicle veh = null;
|
||||
if (GetOwner().ToUnit())
|
||||
if (GetOwner().ToUnit() != null)
|
||||
veh = GetOwner().ToUnit().GetVehicleKit();
|
||||
|
||||
if (!veh) // We should probably just let it stack. Vehicle system will prevent undefined behaviour later
|
||||
if (veh == null) // We should probably just let it stack. Vehicle system will prevent undefined behaviour later
|
||||
return true;
|
||||
|
||||
if (veh.GetAvailableSeatCount() == 0)
|
||||
@@ -1803,7 +1803,7 @@ namespace Game.Spells
|
||||
item = target.ToPlayer().GetUseableItemByPos(InventorySlots.Bag0, EquipmentSlot.OffHand);
|
||||
}
|
||||
|
||||
if (!item || item.IsBroken() || !item.IsFitToSpellRequirements(GetSpellInfo()))
|
||||
if (item == null || item.IsBroken() || !item.IsFitToSpellRequirements(GetSpellInfo()))
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -2717,7 +2717,7 @@ namespace Game.Spells
|
||||
if (target == null && targetPair.Key == GetUnitOwner().GetGUID())
|
||||
target = GetUnitOwner();
|
||||
|
||||
if (target)
|
||||
if (target != null)
|
||||
targets.Add(target, targetPair.Value);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user