summaryrefslogtreecommitdiff
path: root/src/town_cmd.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2008-04-21 11:29:01 +0000
committerrubidium <rubidium@openttd.org>2008-04-21 11:29:01 +0000
commita40bba8bace426b961d31f5b0362629044c0766e (patch)
tree05dfb2564e3487afc402523c5fbe4b764fc97d54 /src/town_cmd.cpp
parent2a779a5e100be9133e21b5645d90d0d390af9ecd (diff)
downloadopenttd-a40bba8bace426b961d31f5b0362629044c0766e.tar.xz
(svn r12817) -Feature: the ability to play NewGRF sounds for industries and stations.
Diffstat (limited to 'src/town_cmd.cpp')
-rw-r--r--src/town_cmd.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/town_cmd.cpp b/src/town_cmd.cpp
index 45de37aeb..b40f41166 100644
--- a/src/town_cmd.cpp
+++ b/src/town_cmd.cpp
@@ -381,16 +381,18 @@ static void MakeSingleHouseBigger(TileIndex tile)
IncHouseConstructionTick(tile);
if (GetHouseConstructionTick(tile) != 0) return;
+ const HouseSpec *hs = GetHouseSpecs(GetHouseType(tile));
+
/* Check and/or */
- if (HasBit(GetHouseSpecs(GetHouseType(tile))->callback_mask, CBM_HOUSE_CONSTRUCTION_STATE_CHANGE)) {
+ if (HasBit(hs->callback_mask, CBM_HOUSE_CONSTRUCTION_STATE_CHANGE)) {
uint16 callback_res = GetHouseCallback(CBID_HOUSE_CONSTRUCTION_STATE_CHANGE, 0, 0, GetHouseType(tile), GetTownByTile(tile), tile);
- if (callback_res != CALLBACK_FAILED) ChangeHouseAnimationFrame(tile, callback_res);
+ if (callback_res != CALLBACK_FAILED) ChangeHouseAnimationFrame(hs->grffile, tile, callback_res);
}
if (IsHouseCompleted(tile)) {
/* Now that construction is complete, we can add the population of the
* building to the town. */
- ChangePopulation(GetTownByTile(tile), GetHouseSpecs(GetHouseType(tile))->population);
+ ChangePopulation(GetTownByTile(tile), hs->population);
SetHouseConstructionYear(tile, _cur_year);
}
MarkTileDirtyByTile(tile);