(arm): Permit arming allied planes.

This commit is contained in:
Markus Armbruster 2006-06-18 17:28:28 +00:00
parent f68ee899e1
commit 9837bf0a40

View file

@ -63,7 +63,8 @@ arm(void)
if (!snxtitem(&ni, EF_PLANE, player->argp[1])) if (!snxtitem(&ni, EF_PLANE, player->argp[1]))
return RET_SYN; return RET_SYN;
while (nxtitem(&ni, &pl)) { while (nxtitem(&ni, &pl)) {
if (!player->owner) if (!player->owner
&& getrel(getnatp(pl.pln_own), player->cnum) != ALLIED)
continue; continue;
plc = &plchr[(int)pl.pln_type]; plc = &plchr[(int)pl.pln_type];
if ((plc->pl_flags & (P_O | P_M)) == (P_O | P_M)) { if ((plc->pl_flags & (P_O | P_M)) == (P_O | P_M)) {
@ -109,6 +110,9 @@ arm(void)
else else
pl.pln_flags &= ~PLN_AIRBURST; pl.pln_flags &= ~PLN_AIRBURST;
snprintf(buf, sizeof(buf), "armed on your %s in %s",
prplane(&pl), xyas(pl.pln_x, pl.pln_y, pl.pln_own));
gift(pl.pln_own, player->cnum, &nuke, EF_NUKE, buf);
pl.pln_nuketype = nuke.nuk_type; pl.pln_nuketype = nuke.nuk_type;
nuke.nuk_plane = pl.pln_uid; nuke.nuk_plane = pl.pln_uid;
putplane(pl.pln_uid, &pl); putplane(pl.pln_uid, &pl);