From eed7a46aeddac874190afc76c9831247ce3db007 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Sun, 29 Apr 2012 09:58:51 +0200 Subject: [PATCH] Fix arm to require nuke and plane to be in the same sector It happily arms a plane with a remote nuke. The nuke gets teleported to the plane when the plane moves (a two-way sortie doesn't count as move). Broken in 4.3.3. Reported by Harald Katzer. --- src/lib/commands/arm.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/lib/commands/arm.c b/src/lib/commands/arm.c index 61ccc2ef5..f7268dd09 100644 --- a/src/lib/commands/arm.c +++ b/src/lib/commands/arm.c @@ -102,6 +102,11 @@ arm(void) prnuke(&nuke), nuke.nuk_plane); return RET_FAIL; } + if (nuke.nuk_x != pl.pln_x || nuke.nuk_y != pl.pln_y) { + pr("%s isn't in the same sector as %s!\n", + prnuke(&nuke), prplane(&pl)); + return RET_FAIL; + } if (*p == 'y' || *p == 'Y') pl.pln_flags |= PLN_AIRBURST; -- 2.43.0