forked from github/server
fix merge conflicts
This commit is contained in:
commit
51ffce6b24
|
@ -1085,7 +1085,6 @@ bool config_token(const char *key, const char *tok) {
|
|||
}
|
||||
|
||||
void free_config(void) {
|
||||
global.functions.maintenance = NULL;
|
||||
global.functions.wage = NULL;
|
||||
free_params(&configuration);
|
||||
}
|
||||
|
|
|
@ -161,11 +161,9 @@ struct param;
|
|||
void *vm_state;
|
||||
int data_version; /* TODO: eliminate in favor of gamedata.version */
|
||||
struct _dictionary_ *inifile;
|
||||
|
||||
struct global_functions {
|
||||
int(*wage) (const struct region * r, const struct faction * f,
|
||||
const struct race * rc, int in_turn);
|
||||
int(*maintenance) (const struct unit * u);
|
||||
} functions;
|
||||
} settings;
|
||||
|
||||
|
|
|
@ -1980,11 +1980,6 @@ int maintenance_cost(const struct unit *u)
|
|||
{
|
||||
if (u == NULL)
|
||||
return MAINTENANCE;
|
||||
if (global.functions.maintenance) {
|
||||
int retval = global.functions.maintenance(u);
|
||||
if (retval >= 0)
|
||||
return retval;
|
||||
}
|
||||
return u_race(u)->maintenance * u->number;
|
||||
}
|
||||
|
||||
|
|
|
@ -898,9 +898,6 @@ static int parse_rules(xmlDocPtr doc)
|
|||
(int(*)(const struct region *, const struct faction *,
|
||||
const struct race *, int))fun;
|
||||
}
|
||||
else if (strcmp((const char *)propValue, "maintenance") == 0) {
|
||||
global.functions.maintenance = (int(*)(const struct unit *))fun;
|
||||
}
|
||||
else {
|
||||
log_error("unknown function for rule '%s'\n", (const char *)propValue);
|
||||
}
|
||||
|
|
|
@ -349,11 +349,6 @@ static void test_fishing_feeds_2_people(CuTest * tc)
|
|||
CuAssertIntEquals(tc, 32, i_get(u->items, rtype->itype));
|
||||
}
|
||||
|
||||
static int not_so_hungry(const unit * u)
|
||||
{
|
||||
return 6 * u->number;
|
||||
}
|
||||
|
||||
static void test_fishing_does_not_give_goblins_money(CuTest * tc)
|
||||
{
|
||||
const resource_type *rtype;
|
||||
|
@ -374,7 +369,6 @@ static void test_fishing_does_not_give_goblins_money(CuTest * tc)
|
|||
u_set_ship(u, sh);
|
||||
i_change(&u->items, rtype->itype, 42);
|
||||
|
||||
global.functions.maintenance = not_so_hungry;
|
||||
scale_number(u, 2);
|
||||
sh->flags |= SF_FISHING;
|
||||
get_food(r);
|
||||
|
|
Loading…
Reference in New Issue