Fixed crash when 'what goes up' is active and a thrown missile is destroyed.

This commit is contained in:
Rob Pearce 2016-06-13 23:38:45 +10:00
parent 0b76162f5f
commit 729da5bb52
1 changed files with 11 additions and 9 deletions

View File

@ -16243,16 +16243,18 @@ int real_fireat(lifeform_t *thrower, object_t *o, int amt, cell_t *where, int sp
} }
if (thrower && hasactivespell(thrower, OT_S_WHATGOESUP)) { if (thrower && hasactivespell(thrower, OT_S_WHATGOESUP)) {
// on the ground? if (newob && !isdeadob(newob)) {
if ((newob->pile->where == where) && haslof(newob->pile->where, thrower->cell, LOF_NEED, NULL)) { // on the ground?
if (isplayer(thrower)) { if ((newob->pile->where == where) && haslof(newob->pile->where, thrower->cell, LOF_NEED, NULL)) {
msg("%s returns to you!", obname); if (isplayer(thrower)) {
} else if (cansee(player, thrower)) { msg("%s returns to you!", obname);
msg("%s returns to %s!", obname, throwername); } else if (cansee(player, thrower)) {
} else if (haslos(player, newob->pile->where)) { msg("%s returns to %s!", obname, throwername);
msg("%s returns to someone!", obname); } else if (haslos(player, newob->pile->where)) {
msg("%s returns to someone!", obname);
}
moveob(newob, thrower->pack, newob->amt);
} }
moveob(newob, thrower->pack, newob->amt);
} }
} }
} }