]> git.pond.sub.org Git - empserver/commitdiff
(arm): Permit arming allied planes.
authorMarkus Armbruster <armbru@pond.sub.org>
Sun, 18 Jun 2006 17:28:28 +0000 (17:28 +0000)
committerMarkus Armbruster <armbru@pond.sub.org>
Sun, 18 Jun 2006 17:28:28 +0000 (17:28 +0000)
src/lib/commands/arm.c

index 1cf2da09b4a8a6dd17e231c867c44f6e3e0f076d..a1cf3d59a78cd78e38beb72995c38faa80acedf4 100644 (file)
@@ -63,7 +63,8 @@ arm(void)
     if (!snxtitem(&ni, EF_PLANE, player->argp[1]))
        return RET_SYN;
     while (nxtitem(&ni, &pl)) {
-       if (!player->owner)
+       if (!player->owner
+           && getrel(getnatp(pl.pln_own), player->cnum) != ALLIED)
            continue;
        plc = &plchr[(int)pl.pln_type];
        if ((plc->pl_flags & (P_O | P_M)) == (P_O | P_M)) {
@@ -109,6 +110,9 @@ arm(void)
        else
            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;
        nuke.nuk_plane = pl.pln_uid;
        putplane(pl.pln_uid, &pl);