- crash fix with null pointer.

This commit is contained in:
Christoph Oelckers 2020-11-03 07:05:51 +01:00
parent 88adef3caa
commit c9c649d3f8

View file

@ -303,7 +303,7 @@ inline int hitasprite(DDukeActor* actor, DDukeActor** hit)
{
short m;
int dist = hitasprite(actor->GetIndex(), &m);
if (m >= 0 && hit) *hit = &hittype[m];
if (hit) *hit = m >= 0? &hittype[m] : nullptr;
else *hit = nullptr;
return dist;
}