read_building_reference does not need a callback

This commit is contained in:
Enno Rehling 2018-11-01 21:13:05 +01:00
parent ba9af6d765
commit fc4f32f8e0
4 changed files with 5 additions and 5 deletions

View File

@ -359,7 +359,7 @@ void resolve_building(building *b)
resolve(RESOLVE_BUILDING | b->no, b);
}
int read_building_reference(gamedata * data, building **bp, resolve_fun fun)
int read_building_reference(gamedata * data, building **bp)
{
int id;
READ_INT(data->store, &id);
@ -367,7 +367,7 @@ int read_building_reference(gamedata * data, building **bp, resolve_fun fun)
*bp = findbuilding(id);
if (*bp == NULL) {
*bp = NULL;
ur_add(RESOLVE_BUILDING | id, (void**)bp, fun);
ur_add(RESOLVE_BUILDING | id, (void**)bp, NULL);
}
}
else {

View File

@ -166,7 +166,7 @@ extern "C" {
void resolve_building(building *b);
void write_building_reference(const struct building *b,
struct storage *store);
int read_building_reference(struct gamedata * data, struct building **bp, resolve_fun fun);
int read_building_reference(struct gamedata * data, struct building **bp);
struct building *findbuilding(int n);

View File

@ -50,7 +50,7 @@ static void xmasgate_write(const trigger * t, struct storage *store)
static int xmasgate_read(trigger * t, struct gamedata *data)
{
if (read_building_reference(data, (building **)&t->data.v, NULL) <= 0) {
if (read_building_reference(data, (building **)&t->data.v) <= 0) {
return AT_READ_FAIL;
}
return AT_READ_OK;

View File

@ -75,7 +75,7 @@ static void gate_write(const trigger * t, struct storage *store)
static int gate_read(trigger * t, gamedata *data)
{
gate_data *gd = (gate_data *)t->data.v;
int bc = read_building_reference(data, &gd->gate, NULL);
int bc = read_building_reference(data, &gd->gate);
int rc = read_region_reference(data, &gd->target);
if (bc <= 0 && rc <= 0) {