Fix nil pointer in hit check if shooter gets deleted during no-selfkill-check.

Also rewrite the check using Find_InArray.
shapetextures
Sven Eberhardt 2015-12-22 15:15:08 -05:00
parent 16683c0d1d
commit 4d7033718b
1 changed files with 4 additions and 3 deletions

View File

@ -129,12 +129,13 @@ global func FxHitCheckTimer(object target, proplist effect, int time)
{ {
var ready = true; var ready = true;
// We search for all objects with the id of our shooter. // We search for all objects with the id of our shooter.
for (var foo in FindObjects(Find_AtPoint(target->GetX(), target->GetY()), Find_ID(shooter->GetID()))) if (shooter)
{ {
// If its the shooter... if (FindObject(Find_AtPoint(target->GetX(), target->GetY()), Find_InArray([shooter])))
if(foo == shooter) {
// we may not switch to "live" yet. // we may not switch to "live" yet.
ready = false; ready = false;
}
} }
// Otherwise, the shot will be live. // Otherwise, the shot will be live.
if (ready) if (ready)