Skip to content

Commit

Permalink
Prevent crash when train path_corner is missing target
Browse files Browse the repository at this point in the history
  • Loading branch information
4LT committed Nov 19, 2023
1 parent 84cfcdc commit 957796d
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions plats.qc
Original file line number Diff line number Diff line change
Expand Up @@ -277,10 +277,19 @@ void() train_next =
{
entity targ;

if (self.target == "") {
sound(self, CHAN_VOICE, self.noise, 1, ATTN_NORM);
return;
}

targ = find(world, targetname, self.target);

if (!targ) {
sound(self, CHAN_VOICE, self.noise, 1, ATTN_NORM);
return;
}

self.target = targ.target;
if (!self.target)
objerror("train_next: no next target");
if (targ.wait)
self.wait = targ.wait;
else
Expand Down

0 comments on commit 957796d

Please sign in to comment.