diff --git a/src/newgrf_house.cpp b/src/newgrf_house.cpp index cf87027f1a..b265f4efc0 100644 --- a/src/newgrf_house.cpp +++ b/src/newgrf_house.cpp @@ -719,9 +719,12 @@ bool NewHouseTileLoop(TileIndex tile) /* Check callback 21, which determines if a house should be destroyed. */ if (HasBit(hs->callback_mask, CBM_HOUSE_DESTRUCTION)) { - uint16 callback_res = GetHouseCallback(CBID_HOUSE_DESTRUCTION, 0, 0, GetHouseType(tile), Town::GetByTile(tile), tile); + Town *t = Town::GetByTile(tile); + uint16 callback_res = GetHouseCallback(CBID_HOUSE_DESTRUCTION, 0, 0, GetHouseType(tile), t, tile); if (callback_res != CALLBACK_FAILED && Convert8bitBooleanCallback(hs->grf_prop.grffile, CBID_HOUSE_DESTRUCTION, callback_res)) { - ClearTownHouse(Town::GetByTile(tile), tile); + ClearTownHouse(t, tile); + extern void RemoveNearbyStations(Town *t); + RemoveNearbyStations(t); return false; } } diff --git a/src/town_cmd.cpp b/src/town_cmd.cpp index eecf047869..b65bbed84f 100644 --- a/src/town_cmd.cpp +++ b/src/town_cmd.cpp @@ -572,7 +572,7 @@ uint32 GetWorldPopulation() * Remove stations from nearby station list if a town is no longer in the catchment area of each. * @param t Town to work on */ -static void RemoveNearbyStations(Town *t) +void RemoveNearbyStations(Town *t) { for (StationList::iterator it = t->stations_near.begin(); it != t->stations_near.end(); /* incremented inside loop */) { const Station *st = *it;