/*
* Empire - A multi-player, client/server Internet based war game.
- * Copyright (C) 1986-2008, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ * Copyright (C) 1986-2010, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure
*
* This program is free software; you can redistribute it and/or modify
* ---
*
* ship.c: Ship pre-write data massage
- *
+ *
* Known contributors to this file:
* Dave Pare, 1989
* Steve McClure, 1996
+ * Markus Armbruster, 2004-2008
*/
#include <config.h>
{
struct shpstr *oldsp = old;
struct shpstr *sp = new;
- natid own = sp->shp_own;
+ natid own = sp->shp_effic < SHIP_MINEFF ? 0 : sp->shp_own;
- if (own && sp->shp_effic < SHIP_MINEFF) {
- mpr(own, "\t%s sunk!\n", prship(sp));
- own = 0;
- } else {
- item_prewrite(sp->shp_item);
+ if (!own) {
+ sp->shp_effic = 0;
+ if (sp->shp_own)
+ mpr(sp->shp_own, "\t%s sunk!\n", prship(sp));
}
+ item_prewrite(sp->shp_item);
/* We've avoided assigning to sp->shp_own, in case oldsp == sp */
if (oldsp->shp_own != own)