forked from github/server
bug in pool-parameters (mode and amount mixed up in production code)
This commit is contained in:
parent
ada8c3a52d
commit
7cfc188e64
|
@ -588,7 +588,7 @@ cr_output_ship(FILE * F, const ship * sh, const unit * u, int fcaptain, const fa
|
||||||
}
|
}
|
||||||
/* shore */
|
/* shore */
|
||||||
w = NODIRECTION;
|
w = NODIRECTION;
|
||||||
if (fval(r->terrain, SEA_REGION)) w = sh->coast;
|
if (!fval(r->terrain, SEA_REGION)) w = sh->coast;
|
||||||
if (w != NODIRECTION)
|
if (w != NODIRECTION)
|
||||||
fprintf(F, "%d;Kueste\n", w);
|
fprintf(F, "%d;Kueste\n", w);
|
||||||
|
|
||||||
|
|
|
@ -756,7 +756,7 @@ build(unit * u, const construction * ctype, int completed, int want)
|
||||||
multi = canuse/100;
|
multi = canuse/100;
|
||||||
if (canuse<0) return canuse; /* pass errors to caller */
|
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;
|
made += n;
|
||||||
skills -= n * type->minskill;
|
skills -= n * type->minskill;
|
||||||
|
|
|
@ -836,7 +836,7 @@ pay_spell(unit * u, const spell * sp, int cast_level, int range)
|
||||||
resuse *= cast_level;
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -166,7 +166,7 @@ new_set_resvalue(unit * u, const resource_type * rtype, int value)
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
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;
|
const faction * f = u->faction;
|
||||||
unit *v;
|
unit *v;
|
||||||
|
@ -209,7 +209,7 @@ new_get_pooled(const unit * u, const resource_type * rtype, int mode)
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
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;
|
const faction *f = u->faction;
|
||||||
unit *v;
|
unit *v;
|
||||||
|
|
|
@ -32,8 +32,8 @@ extern "C" {
|
||||||
#define GET_DEFAULT (GET_RESERVE|GET_SLACK|GET_POOLED_SLACK)
|
#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)
|
#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_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, int mode, int count);
|
int new_use_pooled(struct unit * u, const struct resource_type * res, unsigned int mode, int count);
|
||||||
/** use_pooled
|
/** use_pooled
|
||||||
* verbraucht 'count' Objekte der resource 'itm'
|
* verbraucht 'count' Objekte der resource 'itm'
|
||||||
* unter zuhilfenahme des Pools der struct region und Aufbrauch des
|
* unter zuhilfenahme des Pools der struct region und Aufbrauch des
|
||||||
|
|
|
@ -79,7 +79,7 @@ extern "C" {
|
||||||
# define _BSD_SOURCE
|
# define _BSD_SOURCE
|
||||||
# define __USE_BSD
|
# define __USE_BSD
|
||||||
# endif
|
# endif
|
||||||
# include <features.h>
|
/* # include <features.h> */
|
||||||
# include <strings.h> /* strncasecmp-Prototyp */
|
# include <strings.h> /* strncasecmp-Prototyp */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue