extern int planesatxy(coord, coord, int, int);
extern int asw_shipsatxy(coord, coord, int, int, struct plnstr *,
struct shiplist **);
-extern int has_units(coord, coord, natid, struct lndstr *);
+extern int has_units(coord, coord, natid);
extern int adj_units(coord, coord, natid);
extern int islist(char *);
/* maps.c */
for (i = DIR_FIRST; i <= DIR_LAST; i++) {
getsect(x + diroff[i][0], y + diroff[i][1], §);
- if (has_units(sect.sct_x, sect.sct_y, own, NULL))
+ if (has_units(sect.sct_x, sect.sct_y, own))
return 1;
}
return 0;
}
int
-has_units(coord x, coord y, natid cn, struct lndstr *lp)
+has_units(coord x, coord y, natid cn)
{
int n;
struct lndstr land;
for (n = 0; ef_read(EF_LAND, n, &land); n++) {
if (land.lnd_x != x || land.lnd_y != y)
continue;
- if (lp) {
- /* Check this unit. If it is this one, we don't want
- it included in the count. */
- if (lp->lnd_uid == land.lnd_uid)
- continue;
- }
if (land.lnd_own == cn)
return 1;
}
* Known contributors to this file:
* Dave Pare, 1989
* Steve McClure, 1996
- * Markus Armbruster, 2004-2013
+ * Markus Armbruster, 2004-2014
*/
#include <config.h>
sp->sct_oldown = own;
}
- if (own && !civs && !mil && !has_units(sp->sct_x, sp->sct_y, own, NULL)
+ if (own && !civs && !mil && !has_units(sp->sct_x, sp->sct_y, own)
&& !(sp->sct_flags & MOVE_IN_PROGRESS)) {
/* more cruft! */
own = sp->sct_own = 0;
*
* Known contributors to this file:
* Steve McClure, 1998-2000
- * Markus Armbruster, 2004-2012
+ * Markus Armbruster, 2004-2014
*/
#include <config.h>
}
}
if (sp->sct_item[I_CIVIL] == 0 && sp->sct_item[I_MILIT] == 0
- && !has_units(sp->sct_x, sp->sct_y, sp->sct_own, NULL)) {
+ && !has_units(sp->sct_x, sp->sct_y, sp->sct_own)) {
makelost(EF_SECTOR, sp->sct_own, 0, sp->sct_x, sp->sct_y);
sp->sct_own = 0;
sp->sct_oldown = 0;
*
* Known contributors to this file:
* Dave Pare, 1986
- * Markus Armbruster, 2004-2013
+ * Markus Armbruster, 2004-2014
*/
#include <config.h>
sp->sct_oldown = sp->sct_own;
}
if (!civ && !mil && !sp->sct_item[I_UW]
- && !has_units(sp->sct_x, sp->sct_y, sp->sct_own, NULL)) {
+ && !has_units(sp->sct_x, sp->sct_y, sp->sct_own)) {
makelost(EF_SECTOR, sp->sct_own, 0, sp->sct_x, sp->sct_y);
sp->sct_own = 0;
sp->sct_oldown = 0;
* Known contributors to this file:
* Dave Pare, 1986
* Steve McClure, 1996
- * Markus Armbruster, 2004-2013
+ * Markus Armbruster, 2004-2014
*/
#include <config.h>
* they all starved or were plagued off.
*/
if (vec[I_CIVIL] == 0 && vec[I_MILIT] == 0 &&
- !has_units(sp->sct_x, sp->sct_y, sp->sct_own, NULL)) {
+ !has_units(sp->sct_x, sp->sct_y, sp->sct_own)) {
if (!player->simulation) {
makelost(EF_SECTOR, sp->sct_own, 0, sp->sct_x, sp->sct_y);
sp->sct_own = 0;