/*
* Empire - A multi-player, client/server Internet based war game.
- * Copyright (C) 1986-2015, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ * Copyright (C) 1986-2016, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure, Markus Armbruster
*
* Empire is free software: you can redistribute it and/or modify
}
/*
- * Append SP to LIST.
+ * Append @sp to @list.
* Return the new list link.
*/
struct ulist *
}
/*
- * Sweep seamines with engineers in SHIP_LIST for ACTOR.
- * All ships in SHIP_LIST must be in the same sector.
- * If EXPLICIT is non-zero, this is for an explicit sweep command from
+ * Sweep seamines with engineers in @ship_list for @actor.
+ * All ships in @ship_list must be in the same sector.
+ * If @explicit is non-zero, this is for an explicit sweep command from
* a player. Else it's an automatic "on the move" sweep.
- * If TAKEMOB is non-zero, require and charge mobility.
+ * If @takemob is non-zero, require and charge mobility.
* Return non-zero when the ships should stop.
*/
int
}
/*
- * Return whether and why SP would be stuck in SECTP.
+ * Return whether and why @sp would be stuck in @sectp.
*/
enum shp_stuck
shp_check_nav(struct shpstr *sp, struct sctstr *sectp)
if (msl_hit(&plp->plane,
shp_hardtarget(&mvs->unit.ship), EF_SHIP,
N_SHP_MISS, N_SHP_SMISS, sublaunch, victim)) {
- dam = pln_damage(&plp->plane, 'p', 1);
+ dam = pln_damage(&plp->plane, 'p', "");
mpr(victim,
"missile interdiction mission does %d damage to %s!\n",
dam, prship(&mvs->unit.ship));
shp_damage_one(mvs, dam);
} else {
- dam = pln_damage(&plp->plane, 'p', 0);
+ dam = pln_damage(&plp->plane, 'p', NULL);
collateral_damage(newx, newy, dam);
}
mvs = most_valuable_ship(list, newx, newy);
putship(mlp->unit.ship.shp_uid, &mlp->unit.ship);
}
- return 0;
+ return QEMPTY(list);
}
int
shp_nav_gauntlet(struct emp_qelem *list, int interdict, natid actor)
{
struct ulist *mlp = (struct ulist *)list->q_back;
- coord newx = mlp->unit.ship.shp_x;
- coord newy = mlp->unit.ship.shp_y;
+ coord newx, newy;
int stopping;
+ if (CANT_HAPPEN(QEMPTY(list)))
+ return 1;
+ newx = mlp->unit.ship.shp_x;
+ newy = mlp->unit.ship.shp_y;
stopping = shp_sweep(list, 0, 0, actor);
if (QEMPTY(list))
- return stopping;
+ return 1;
stopping |= shp_check_mines(list);
if (QEMPTY(list))
- return stopping;
+ return 1;
if (interdict)
stopping |= shp_interdict(list, newx, newy, actor);
}
/*
- * Set SP's tech to TLEV along with everything else that depends on it.
+ * Set @sp's tech to @tlev along with everything else that depends on it.
*/
void
shp_set_tech(struct shpstr *sp, int tlev)