Fix fire command to detect when the firing object changes

multifire() failed to take into account that the firing firing sector,
ship or land unit can change while it is getting the target argument.
It thus clobbered any updates made to the firing object while it was
sleeping for the target argument.  Abusable.  Broken when Chainsaw
introduced MULTIFIRE.
This commit is contained in:
Markus Armbruster 2008-05-04 16:44:26 +02:00
parent bf2fd6cb82
commit 66165f34cb

View file

@ -253,6 +253,8 @@ multifire(void)
y = vsect.sct_y;
}
if (type == EF_SHIP) {
if (!check_ship_ok(&fship))
return RET_FAIL;
if (fship.shp_own != player->cnum) {
pr("Not your ship!\n");
continue;
@ -305,6 +307,8 @@ multifire(void)
putship(fship.shp_uid, &fship);
}
} else if (type == EF_LAND) {
if (!check_land_ok(&fland))
return RET_FAIL;
if (fland.lnd_own != player->cnum) {
pr("Not your unit!\n");
continue;
@ -349,6 +353,8 @@ multifire(void)
dam = ldround(dam / 2.0, 1);
}
} else {
if (!check_sect_ok(&fsect))
return RET_FAIL;
fx = fsect.sct_x;
fy = fsect.sct_y;
if (fsect.sct_own != player->cnum ||