Fixed a crash

This commit is contained in:
hondacrx
2022-08-01 11:31:56 -04:00
parent 3d1c0384f0
commit bd3dfeb637
2 changed files with 19 additions and 19 deletions
+6 -6
View File
@@ -42,30 +42,30 @@ namespace Game.Spells
m_src = new SpellDestination();
m_dst = new SpellDestination();
if (spellCastRequest.Target.SrcLocation.HasValue)
if (spellCastRequest.Target.SrcLocation != null)
{
m_src.TransportGUID = spellCastRequest.Target.SrcLocation.Value.Transport;
m_src.TransportGUID = spellCastRequest.Target.SrcLocation.Transport;
Position pos;
if (!m_src.TransportGUID.IsEmpty())
pos = m_src.TransportOffset;
else
pos = m_src.Position;
pos.Relocate(spellCastRequest.Target.SrcLocation.Value.Location);
pos.Relocate(spellCastRequest.Target.SrcLocation.Location);
if (spellCastRequest.Target.Orientation.HasValue)
pos.SetOrientation(spellCastRequest.Target.Orientation.Value);
}
if (spellCastRequest.Target.DstLocation.HasValue)
if (spellCastRequest.Target.DstLocation != null)
{
m_dst.TransportGUID = spellCastRequest.Target.DstLocation.Value.Transport;
m_dst.TransportGUID = spellCastRequest.Target.DstLocation.Transport;
Position pos;
if (!m_dst.TransportGUID.IsEmpty())
pos = m_dst.TransportOffset;
else
pos = m_dst.Position;
pos.Relocate(spellCastRequest.Target.DstLocation.Value.Location);
pos.Relocate(spellCastRequest.Target.DstLocation.Location);
if (spellCastRequest.Target.Orientation.HasValue)
pos.SetOrientation(spellCastRequest.Target.Orientation.Value);
}