]> git.pond.sub.org Git - empserver/commitdiff
Clean up confusing use of def->own in move_in_land()
authorMarkus Armbruster <armbru@pond.sub.org>
Sun, 20 Jun 2010 08:40:00 +0000 (10:40 +0200)
committerMarkus Armbruster <armbru@pond.sub.org>
Sat, 24 Jul 2010 09:28:33 +0000 (11:28 +0200)
It passed def->own to lnd_sweep(), which looks like a bug.  But it's
actually player->cnum there, because take_def() already set def->own
to player->owner: take_def() first changes the owner of the attacked
sector by calling takeover(), then updates def->own from that in
att_get_combat().

src/lib/subs/attsub.c

index c0f22deeb20a0c33a35e6cc0164b5206d4ac4cb5..0edf5d148354c2749c4f336c7253cd33cfc3d87f 100644 (file)
@@ -2379,7 +2379,7 @@ move_in_land(int combat_mode, struct combat *off, struct emp_qelem *olist,
        return;
     if (def->type == EF_SECTOR) {
        if (opt_INTERDICT_ATT) {
-           lnd_sweep(olist, 0, 0, def->own);
+           lnd_sweep(olist, 0, 0, player->cnum);
            lnd_check_mines(olist);
        }
        sprintf(buf, "now occupies %s", prcom(0, def));