diff --git a/src/kernel/config.c b/src/kernel/config.c index 96ac6d3c6..d3093c58e 100644 --- a/src/kernel/config.c +++ b/src/kernel/config.c @@ -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); } diff --git a/src/kernel/config.h b/src/kernel/config.h index dda7873aa..34bd91e9b 100644 --- a/src/kernel/config.h +++ b/src/kernel/config.h @@ -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; diff --git a/src/kernel/unit.c b/src/kernel/unit.c index 1c6553c79..e41e5b006 100644 --- a/src/kernel/unit.c +++ b/src/kernel/unit.c @@ -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; } diff --git a/src/kernel/xmlreader.c b/src/kernel/xmlreader.c index e1e476cd6..f4e5fd751 100644 --- a/src/kernel/xmlreader.c +++ b/src/kernel/xmlreader.c @@ -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); } diff --git a/src/laws.test.c b/src/laws.test.c index 623717619..4d001948a 100644 --- a/src/laws.test.c +++ b/src/laws.test.c @@ -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);