From 75363a0525a18285a23ac7a38b6e05625e0ed998 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Sat, 13 May 2006 07:22:47 +0000 Subject: [PATCH] (pln_prewrite): Destroy nuke along with the plane carrying it. This is required since arming doesn't remove nukes from the nuke file anymore (arm.c rev. 1.15). --- src/lib/subs/plane.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/lib/subs/plane.c b/src/lib/subs/plane.c index 85d95778..89506a85 100644 --- a/src/lib/subs/plane.c +++ b/src/lib/subs/plane.c @@ -111,6 +111,8 @@ pln_prewrite(int n, void *ptr) { struct plnstr *pp = ptr; struct plnstr plane; + struct nukstr *np; + int i; if (pp->pln_effic < PLANE_MINEFF) { if (pp->pln_own) @@ -118,6 +120,17 @@ pln_prewrite(int n, void *ptr) pp->pln_y); pp->pln_own = 0; pp->pln_effic = 0; + for (i = 0; NULL != (np = getnukep(i)); i++) { + if (np->nuk_own && np->nuk_plane == n) { + mpr(np->nuk_own, "%s lost!\n", prnuke(np)); + makelost(EF_NUKE, np->nuk_own, np->nuk_uid, + np->nuk_x, np->nuk_y); + np->nuk_own = 0; + np->nuk_effic = 0; + np->nuk_plane = -1; + putnuke(np->nuk_uid, np); + } + } } pp->ef_type = EF_PLANE; pp->pln_uid = n;