]> git.pond.sub.org Git - empserver/commitdiff
Fix launch not to wipe out target sector updates
authorMarkus Armbruster <armbru@pond.sub.org>
Sat, 26 Dec 2009 13:02:50 +0000 (14:02 +0100)
committerMarkus Armbruster <armbru@pond.sub.org>
Sat, 26 Dec 2009 13:02:50 +0000 (14:02 +0100)
Launching ABMs updates their base, in mission_pln_equip().  The update
got wiped out when launch_missile() wrote back the target sector,
triggering a seqno mismatch oops.  Harmless with the stock game's
ABMs, because they use neither shells nor petrol.

Fix by re-reading the target sector.

src/lib/commands/laun.c

index 932b4bd15b94d3f84ed7879fb5ac4cf2a80fa2e5..c4553398c902cf48eccd82f463cf9929317e163e 100644 (file)
@@ -246,6 +246,7 @@ launch_missile(struct plnstr *pp)
        if (msl_launch(pp, EF_SECTOR, "sector", sx, sy, sect.sct_own,
                       &sublaunch) < 0)
            return RET_OK;
+       getsect(sx, sy, &sect);
        if (!msl_hit(pp, SECT_HARDTARGET, EF_SECTOR,
                     N_SCT_MISS, N_SCT_SMISS, sublaunch, sect.sct_own))
            CANT_REACH();