summaryrefslogtreecommitdiff
path: root/src/town_cmd.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2008-04-20 08:43:31 +0000
committerrubidium <rubidium@openttd.org>2008-04-20 08:43:31 +0000
commit181b36ca0b4a8b61537cafb99c7990e73c26408b (patch)
tree0ba526cb5a7ba1bd88bfb60e41c986196da6316e /src/town_cmd.cpp
parent15680e477a2447a590fa2fc20364c74d8e151aa3 (diff)
downloadopenttd-181b36ca0b4a8b61537cafb99c7990e73c26408b.tar.xz
(svn r12801) -Codechange: remove the dependency of function.h in town_map.h
Diffstat (limited to 'src/town_cmd.cpp')
-rw-r--r--src/town_cmd.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/town_cmd.cpp b/src/town_cmd.cpp
index 66cc9e945..45de37aeb 100644
--- a/src/town_cmd.cpp
+++ b/src/town_cmd.cpp
@@ -45,6 +45,9 @@
#include "economy_func.h"
#include "station_func.h"
#include "cheat_func.h"
+#include "functions.h"
+#include "animated_tile_func.h"
+#include "date_func.h"
#include "table/strings.h"
#include "table/sprites.h"
@@ -268,7 +271,10 @@ static void AnimateTile_Town(TileIndex tile)
pos += (pos < dest) ? 1 : -1;
SetLiftPosition(tile, pos);
- if (pos == dest) HaltLift(tile);
+ if (pos == dest) {
+ HaltLift(tile);
+ DeleteAnimatedTile(tile);
+ }
MarkTileDirtyByTile(tile);
}
@@ -385,6 +391,7 @@ static void MakeSingleHouseBigger(TileIndex tile)
/* Now that construction is complete, we can add the population of the
* building to the town. */
ChangePopulation(GetTownByTile(tile), GetHouseSpecs(GetHouseType(tile))->population);
+ SetHouseConstructionYear(tile, _cur_year);
}
MarkTileDirtyByTile(tile);
}
@@ -1644,6 +1651,9 @@ static inline void ClearMakeHouseTile(TileIndex tile, TownID tid, byte counter,
assert(CmdSucceeded(cc));
MakeHouseTile(tile, tid, counter, stage, type, random_bits);
+ if (GetHouseSpecs(type)->building_flags & BUILDING_IS_ANIMATED) AddAnimatedTile(tile);
+
+ MarkTileDirtyByTile(tile);
}