bug in pool-parameters (mode and amount mixed up in production code)

This commit is contained in:
Enno Rehling 2005-10-30 11:55:22 +00:00
parent ada8c3a52d
commit 7cfc188e64
6 changed files with 8 additions and 8 deletions

View File

@ -588,7 +588,7 @@ cr_output_ship(FILE * F, const ship * sh, const unit * u, int fcaptain, const fa
}
/* shore */
w = NODIRECTION;
if (fval(r->terrain, SEA_REGION)) w = sh->coast;
if (!fval(r->terrain, SEA_REGION)) w = sh->coast;
if (w != NODIRECTION)
fprintf(F, "%d;Kueste\n", w);

View File

@ -756,7 +756,7 @@ build(unit * u, const construction * ctype, int completed, int want)
multi = canuse/100;
if (canuse<0) return canuse; /* pass errors to caller */
new_use_pooled(u, rtype, (need-prebuilt+multi-1)/multi, GET_DEFAULT);
new_use_pooled(u, rtype, GET_DEFAULT, (need-prebuilt+multi-1)/multi);
}
made += n;
skills -= n * type->minskill;

View File

@ -836,7 +836,7 @@ pay_spell(unit * u, const spell * sp, int cast_level, int range)
resuse *= cast_level;
}
new_use_pooled(u, sp->components[k].type, resuse, GET_DEFAULT);
new_use_pooled(u, sp->components[k].type, GET_DEFAULT, resuse);
}
}

View File

@ -166,7 +166,7 @@ new_set_resvalue(unit * u, const resource_type * rtype, int value)
}
int
new_get_pooled(const unit * u, const resource_type * rtype, int mode)
new_get_pooled(const unit * u, const resource_type * rtype, unsigned int mode)
{
const faction * f = u->faction;
unit *v;
@ -209,7 +209,7 @@ new_get_pooled(const unit * u, const resource_type * rtype, int mode)
}
int
new_use_pooled(unit * u, const resource_type * rtype, int mode, int count)
new_use_pooled(unit * u, const resource_type * rtype, unsigned int mode, int count)
{
const faction *f = u->faction;
unit *v;

View File

@ -32,8 +32,8 @@ extern "C" {
#define GET_DEFAULT (GET_RESERVE|GET_SLACK|GET_POOLED_SLACK)
#define GET_ALL (GET_SLACK|GET_RESERVE|GET_POOLED_SLACK|GET_POOLED_RESERVE|GET_POOLED_FORCE)
int new_get_pooled(const struct unit * u, const struct resource_type * res, int mode);
int new_use_pooled(struct unit * u, const struct resource_type * res, int mode, int count);
int new_get_pooled(const struct unit * u, const struct resource_type * res, unsigned int mode);
int new_use_pooled(struct unit * u, const struct resource_type * res, unsigned int mode, int count);
/** use_pooled
* verbraucht 'count' Objekte der resource 'itm'
* unter zuhilfenahme des Pools der struct region und Aufbrauch des

View File

@ -79,7 +79,7 @@ extern "C" {
# define _BSD_SOURCE
# define __USE_BSD
# endif
# include <features.h>
/* # include <features.h> */
# include <strings.h> /* strncasecmp-Prototyp */
#endif