/*
* Empire - A multi-player, client/server Internet based war game.
- * Copyright (C) 1986-2013, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ * Copyright (C) 1986-2020, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure, Markus Armbruster
*
* Empire is free software: you can redistribute it and/or modify
*
* Known contributors to this file:
* Ken Stevens, 1995
+ * Markus Armbruster, 2011-2015
*/
#include <config.h>
struct sctstr sect;
struct lndstr land;
struct nstr_item ni;
- int foundland;
+ int foundland, def_uid;
+ natid def_own;
char *p;
char buf[1024];
return RET_OK;
}
- /* Show what we're boarding, and check treaties */
-
- if (att_show(def))
- return RET_FAIL;
+ /* Show what we're boarding */
+ att_show(def);
/* Ask the player what he wants to board with */
* Death, carnage, and destruction.
*/
+ /*
+ * Careful: when the fight sinks the ship, put_combat() clobbers
+ * *def (see FIXME there).
+ */
+ def_uid = def->shp_uid;
+ def_own = def->own;
if (!(att_fight(A_BOARD, off, &olist, 1.0, def, &dlist, 1.0))) {
- getship(def->shp_uid, &ship);
+ getship(def_uid, &ship);
if (ship.shp_rflags & RET_BOARDED) {
- retreat_ship(&ship, 'u');
- putship(def->shp_uid, &ship);
+ retreat_ship(&ship, def_own, 'u');
+ putship(def_uid, &ship);
}
}