Fixes/Crashes:
command "cometome" Using call pet on hunter crash when casting some spells.
This commit is contained in:
@@ -283,7 +283,7 @@ namespace Game.Entities
|
|||||||
}
|
}
|
||||||
else if (PetSaveMode.FirstActiveSlot <= slot && slot <= PetSaveMode.LastActiveSlot)
|
else if (PetSaveMode.FirstActiveSlot <= slot && slot <= PetSaveMode.LastActiveSlot)
|
||||||
{
|
{
|
||||||
var activePetIndex = Array.FindIndex(petStable.ActivePets, pet => pet?.PetNumber == petnumber);
|
var activePetIndex = Array.FindIndex(petStable.ActivePets, pet => pet?.PetNumber == petInfo.PetNumber);
|
||||||
|
|
||||||
Cypher.Assert(activePetIndex != -1);
|
Cypher.Assert(activePetIndex != -1);
|
||||||
|
|
||||||
|
|||||||
@@ -60,6 +60,9 @@ namespace Game.Movement
|
|||||||
owner.AddUnitState(UnitState.RoamingMove);
|
owner.AddUnitState(UnitState.RoamingMove);
|
||||||
|
|
||||||
MoveSplineInit init = new(owner);
|
MoveSplineInit init = new(owner);
|
||||||
|
|
||||||
|
new Action(() =>
|
||||||
|
{
|
||||||
if (_generatePath)
|
if (_generatePath)
|
||||||
{
|
{
|
||||||
PathGenerator path = new(owner);
|
PathGenerator path = new(owner);
|
||||||
@@ -79,6 +82,7 @@ namespace Game.Movement
|
|||||||
owner.MovePosition(dest, Math.Min(_closeEnoughDistance.Value, dest.GetExactDist(owner)), MathF.PI + owner.GetRelativeAngle(dest));
|
owner.MovePosition(dest, Math.Min(_closeEnoughDistance.Value, dest.GetExactDist(owner)), MathF.PI + owner.GetRelativeAngle(dest));
|
||||||
|
|
||||||
init.MoveTo(dest.GetPositionX(), dest.GetPositionY(), dest.GetPositionZ(), false);
|
init.MoveTo(dest.GetPositionX(), dest.GetPositionY(), dest.GetPositionZ(), false);
|
||||||
|
})();
|
||||||
|
|
||||||
if (_speed.HasValue)
|
if (_speed.HasValue)
|
||||||
init.SetVelocity(_speed.Value);
|
init.SetVelocity(_speed.Value);
|
||||||
|
|||||||
@@ -98,9 +98,6 @@ namespace Game.Spells
|
|||||||
|
|
||||||
for (var i = 0; i < SpellConst.MaxEffects; ++i)
|
for (var i = 0; i < SpellConst.MaxEffects; ++i)
|
||||||
m_destTargets[i] = new SpellDestination(m_caster);
|
m_destTargets[i] = new SpellDestination(m_caster);
|
||||||
|
|
||||||
m_targets = new SpellCastTargets();
|
|
||||||
m_appliedMods = new List<Aura>();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual void Dispose()
|
public virtual void Dispose()
|
||||||
@@ -7964,11 +7961,11 @@ namespace Game.Spells
|
|||||||
public SpellMisc m_misc;
|
public SpellMisc m_misc;
|
||||||
public object m_customArg;
|
public object m_customArg;
|
||||||
public SpellCastVisual m_SpellVisual;
|
public SpellCastVisual m_SpellVisual;
|
||||||
public SpellCastTargets m_targets;
|
public SpellCastTargets m_targets = new();
|
||||||
public sbyte m_comboPointGain;
|
public sbyte m_comboPointGain;
|
||||||
public SpellCustomErrors m_customError;
|
public SpellCustomErrors m_customError;
|
||||||
|
|
||||||
public List<Aura> m_appliedMods;
|
public List<Aura> m_appliedMods = new();
|
||||||
|
|
||||||
WorldObject m_caster;
|
WorldObject m_caster;
|
||||||
public SpellValue m_spellValue;
|
public SpellValue m_spellValue;
|
||||||
|
|||||||
Reference in New Issue
Block a user