(nxtitemp): Remove last parameter. Non-zero argument doesn't make

sense and is never passed.  Callers changed.
This commit is contained in:
Markus Armbruster 2005-05-28 08:22:42 +00:00
parent e27724fbc9
commit 9b28594b5b
4 changed files with 10 additions and 16 deletions

View file

@ -771,7 +771,7 @@ extern int load_it(struct shpstr *, struct sctstr *,
extern void unload_it(struct shpstr *); extern void unload_it(struct shpstr *);
extern void auto_fuel_ship(struct shpstr *); extern void auto_fuel_ship(struct shpstr *);
/* nxtitemp.c */ /* nxtitemp.c */
extern s_char *nxtitemp(struct nstr_item *, int); extern s_char *nxtitemp(struct nstr_item *);
/* nxtsctp.c */ /* nxtsctp.c */
extern struct sctstr *nxtsctp(register struct nstr_sect *); extern struct sctstr *nxtsctp(register struct nstr_sect *);
/* plague.c */ /* plague.c */

View file

@ -44,7 +44,7 @@
#include "common.h" #include "common.h"
s_char * s_char *
nxtitemp(struct nstr_item *np, int owner) nxtitemp(struct nstr_item *np)
{ {
struct genitem *gp; struct genitem *gp;
int selected; int selected;
@ -66,13 +66,7 @@ nxtitemp(struct nstr_item *np, int owner)
selected = 1; selected = 1;
switch (np->sel) { switch (np->sel) {
/*
* This one won't work unless you're running in emp_player
*
*/
case NS_LIST: case NS_LIST:
if ((np->flags & EFF_OWNER) && !owner)
selected = 0;
break; break;
case NS_ALL: case NS_ALL:
/* XXX maybe combine NS_LIST and NS_ALL later */ /* XXX maybe combine NS_LIST and NS_ALL later */

View file

@ -168,7 +168,7 @@ guerrilla(struct sctstr *sp)
snxtitem_xy(&ni, EF_LAND, sp->sct_x, sp->sct_y); snxtitem_xy(&ni, EF_LAND, sp->sct_x, sp->sct_y);
while (NULL != (lp = (struct lndstr *)nxtitemp(&ni, 0))) { while (NULL != (lp = (struct lndstr *)nxtitemp(&ni))) {
if (lp->lnd_own != sp->sct_own) if (lp->lnd_own != sp->sct_own)
continue; continue;
@ -463,7 +463,7 @@ take_casualties(struct sctstr *sp, int mc)
* Try not to kill any unit. * Try not to kill any unit.
*/ */
snxtitem_xy(&ni, EF_LAND, sp->sct_x, sp->sct_y); snxtitem_xy(&ni, EF_LAND, sp->sct_x, sp->sct_y);
while (NULL != (lp = (struct lndstr *)nxtitemp(&ni, 0))) { while (NULL != (lp = (struct lndstr *)nxtitemp(&ni))) {
nunits++; nunits++;
if (lchr[(int)lp->lnd_type].l_flags & L_SECURITY) if (lchr[(int)lp->lnd_type].l_flags & L_SECURITY)
nunits++; nunits++;
@ -476,7 +476,7 @@ take_casualties(struct sctstr *sp, int mc)
/* kill some security troops */ /* kill some security troops */
snxtitem_xy(&ni, EF_LAND, sp->sct_x, sp->sct_y); snxtitem_xy(&ni, EF_LAND, sp->sct_x, sp->sct_y);
while (NULL != (lp = (struct lndstr *)nxtitemp(&ni, 0))) { while (NULL != (lp = (struct lndstr *)nxtitemp(&ni))) {
if (!(lchr[(int)lp->lnd_type].l_flags & L_SECURITY)) if (!(lchr[(int)lp->lnd_type].l_flags & L_SECURITY))
continue; continue;
@ -507,7 +507,7 @@ take_casualties(struct sctstr *sp, int mc)
/* kill some normal troops */ /* kill some normal troops */
snxtitem_xy(&ni, EF_LAND, sp->sct_x, sp->sct_y); snxtitem_xy(&ni, EF_LAND, sp->sct_x, sp->sct_y);
while (NULL != (lp = (struct lndstr *)nxtitemp(&ni, 0))) { while (NULL != (lp = (struct lndstr *)nxtitemp(&ni))) {
if (lchr[(int)lp->lnd_type].l_flags & L_SECURITY) if (lchr[(int)lp->lnd_type].l_flags & L_SECURITY)
continue; continue;
@ -535,7 +535,7 @@ take_casualties(struct sctstr *sp, int mc)
/* Hmm.. still some left.. kill off units now */ /* Hmm.. still some left.. kill off units now */
/* kill some normal troops */ /* kill some normal troops */
snxtitem_xy(&ni, EF_LAND, sp->sct_x, sp->sct_y); snxtitem_xy(&ni, EF_LAND, sp->sct_x, sp->sct_y);
while (NULL != (lp = (struct lndstr *)nxtitemp(&ni, 0))) { while (NULL != (lp = (struct lndstr *)nxtitemp(&ni))) {
if (lchr[(int)lp->lnd_type].l_flags & L_SECURITY) if (lchr[(int)lp->lnd_type].l_flags & L_SECURITY)
continue; continue;
@ -553,7 +553,7 @@ take_casualties(struct sctstr *sp, int mc)
/* Hmm.. still some left.. kill off units now */ /* Hmm.. still some left.. kill off units now */
/* kill some security troops */ /* kill some security troops */
snxtitem_xy(&ni, EF_LAND, sp->sct_x, sp->sct_y); snxtitem_xy(&ni, EF_LAND, sp->sct_x, sp->sct_y);
while (NULL != (lp = (struct lndstr *)nxtitemp(&ni, 0))) { while (NULL != (lp = (struct lndstr *)nxtitemp(&ni))) {
if (!(lchr[(int)lp->lnd_type].l_flags & L_SECURITY)) if (!(lchr[(int)lp->lnd_type].l_flags & L_SECURITY))
continue; continue;

View file

@ -393,7 +393,7 @@ shiprepair(struct shpstr *ship, struct natstr *np,
np->nat_money -= mult * mp->m_cost * build / 100.0; np->nat_money -= mult * mp->m_cost * build / 100.0;
if (!player->simulation) if (!player->simulation)
ship->shp_effic += (s_char)build; ship->shp_effic += build;
return 1; return 1;
} }
@ -431,7 +431,7 @@ feed_ship(struct shpstr *sp, int etus, int *needed, int doit)
/* doit - only steal food from land units during the update */ /* doit - only steal food from land units during the update */
if (ifood_eaten > sp->shp_item[I_FOOD] && sp->shp_nland > 0 && doit) { if (ifood_eaten > sp->shp_item[I_FOOD] && sp->shp_nland > 0 && doit) {
snxtitem_all(&ni, EF_LAND); snxtitem_all(&ni, EF_LAND);
while ((lp = (struct lndstr *)nxtitemp(&ni, 0)) && while ((lp = (struct lndstr *)nxtitemp(&ni)) &&
ifood_eaten > sp->shp_item[I_FOOD]) { ifood_eaten > sp->shp_item[I_FOOD]) {
if (lp->lnd_ship != sp->shp_uid) if (lp->lnd_ship != sp->shp_uid)
continue; continue;