diff --git a/include/prototypes.h b/include/prototypes.h index 74ae8c5e..b988d7f2 100644 --- a/include/prototypes.h +++ b/include/prototypes.h @@ -771,7 +771,7 @@ extern int load_it(struct shpstr *, struct sctstr *, extern void unload_it(struct shpstr *); extern void auto_fuel_ship(struct shpstr *); /* nxtitemp.c */ -extern s_char *nxtitemp(struct nstr_item *, int); +extern s_char *nxtitemp(struct nstr_item *); /* nxtsctp.c */ extern struct sctstr *nxtsctp(register struct nstr_sect *); /* plague.c */ diff --git a/src/lib/update/nxtitemp.c b/src/lib/update/nxtitemp.c index ba8379f5..a9088c59 100644 --- a/src/lib/update/nxtitemp.c +++ b/src/lib/update/nxtitemp.c @@ -44,7 +44,7 @@ #include "common.h" s_char * -nxtitemp(struct nstr_item *np, int owner) +nxtitemp(struct nstr_item *np) { struct genitem *gp; int selected; @@ -66,13 +66,7 @@ nxtitemp(struct nstr_item *np, int owner) selected = 1; switch (np->sel) { - /* - * This one won't work unless you're running in emp_player - * - */ case NS_LIST: - if ((np->flags & EFF_OWNER) && !owner) - selected = 0; break; case NS_ALL: /* XXX maybe combine NS_LIST and NS_ALL later */ diff --git a/src/lib/update/revolt.c b/src/lib/update/revolt.c index fa7e985b..1c489603 100644 --- a/src/lib/update/revolt.c +++ b/src/lib/update/revolt.c @@ -168,7 +168,7 @@ guerrilla(struct sctstr *sp) 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) continue; @@ -463,7 +463,7 @@ take_casualties(struct sctstr *sp, int mc) * Try not to kill any unit. */ 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++; if (lchr[(int)lp->lnd_type].l_flags & L_SECURITY) nunits++; @@ -476,7 +476,7 @@ take_casualties(struct sctstr *sp, int mc) /* kill some security troops */ 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)) continue; @@ -507,7 +507,7 @@ take_casualties(struct sctstr *sp, int mc) /* kill some normal troops */ 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) continue; @@ -535,7 +535,7 @@ take_casualties(struct sctstr *sp, int mc) /* Hmm.. still some left.. kill off units now */ /* kill some normal troops */ 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) continue; @@ -553,7 +553,7 @@ take_casualties(struct sctstr *sp, int mc) /* Hmm.. still some left.. kill off units now */ /* kill some security troops */ 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)) continue; diff --git a/src/lib/update/ship.c b/src/lib/update/ship.c index 5e8e5652..8b462667 100644 --- a/src/lib/update/ship.c +++ b/src/lib/update/ship.c @@ -393,7 +393,7 @@ shiprepair(struct shpstr *ship, struct natstr *np, np->nat_money -= mult * mp->m_cost * build / 100.0; if (!player->simulation) - ship->shp_effic += (s_char)build; + ship->shp_effic += build; 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 */ if (ifood_eaten > sp->shp_item[I_FOOD] && sp->shp_nland > 0 && doit) { 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]) { if (lp->lnd_ship != sp->shp_uid) continue;