subs: Drop has_units() parameter lp, it's always null now
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
This commit is contained in:
parent
7c1b1661f5
commit
5d0faf7a88
6 changed files with 11 additions and 17 deletions
|
@ -452,7 +452,7 @@ extern int unitsatxy(coord, coord, int, int, int);
|
|||
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 */
|
||||
|
|
|
@ -256,14 +256,14 @@ adj_units(coord x, coord y, natid own)
|
|||
|
||||
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;
|
||||
|
@ -271,12 +271,6 @@ has_units(coord x, coord y, natid cn, struct lndstr *lp)
|
|||
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;
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
* Known contributors to this file:
|
||||
* Dave Pare, 1989
|
||||
* Steve McClure, 1996
|
||||
* Markus Armbruster, 2004-2013
|
||||
* Markus Armbruster, 2004-2014
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
@ -83,7 +83,7 @@ sct_prewrite(int id, void *old, void *new)
|
|||
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;
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
*
|
||||
* Known contributors to this file:
|
||||
* Steve McClure, 1998-2000
|
||||
* Markus Armbruster, 2004-2012
|
||||
* Markus Armbruster, 2004-2014
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
@ -100,7 +100,7 @@ do_plague(struct sctstr *sp, struct natstr *np, int etu)
|
|||
}
|
||||
}
|
||||
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;
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
*
|
||||
* Known contributors to this file:
|
||||
* Dave Pare, 1986
|
||||
* Markus Armbruster, 2004-2013
|
||||
* Markus Armbruster, 2004-2014
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
@ -51,7 +51,7 @@ populace(struct natstr *np, struct sctstr *sp, int etu)
|
|||
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;
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
* Known contributors to this file:
|
||||
* Dave Pare, 1986
|
||||
* Steve McClure, 1996
|
||||
* Markus Armbruster, 2004-2013
|
||||
* Markus Armbruster, 2004-2014
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
@ -287,7 +287,7 @@ produce_sect(int natnum, int etu, struct bp *bp, int p_sect[][2])
|
|||
* 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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue