summaryrefslogtreecommitdiff
path: root/openttd.c
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2006-12-30 11:57:52 +0000
committerrubidium <rubidium@openttd.org>2006-12-30 11:57:52 +0000
commit5f88e816416ee78b3b693253c0ff298c36459a8b (patch)
tree208ddbfdccba148fd9aa969b5124fe9c495ba540 /openttd.c
parentc7b1fd6fc2dd73e9b9bf150b5bb81e340fa75958 (diff)
downloadopenttd-5f88e816416ee78b3b693253c0ff298c36459a8b.tar.xz
(svn r7642) -Codechange: unify all the different locations where the animation state is stored into a single location.
Diffstat (limited to 'openttd.c')
-rw-r--r--openttd.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/openttd.c b/openttd.c
index b3865da42..023d9588b 100644
--- a/openttd.c
+++ b/openttd.c
@@ -60,6 +60,7 @@
#include "rail_map.h"
#include "road_map.h"
#include "water_map.h"
+#include "industry_map.h"
#include <stdarg.h>
@@ -1632,6 +1633,33 @@ bool AfterLoadGame(void)
SettingsDisableElrail(_patches.disable_elrails);
}
+ if (CheckSavegameVersion(43)) {
+ BEGIN_TILE_LOOP(tile_cur, MapSizeX(), MapSizeY(), 0) {
+ if (IsTileType(tile_cur, MP_INDUSTRY)) {
+ switch (GetIndustryGfx(tile_cur)) {
+ case GFX_POWERPLANT_SPARKS:
+ SetIndustryAnimationState(tile_cur, GB(_m[tile_cur].m1, 2, 5));
+ break;
+
+ case GFX_OILWELL_ANIMATED_1:
+ case GFX_OILWELL_ANIMATED_2:
+ case GFX_OILWELL_ANIMATED_3:
+ SetIndustryAnimationState(tile_cur, GB(_m[tile_cur].m1, 0, 2));
+ break;
+
+ case GFX_COAL_MINE_TOWER_ANIMATED:
+ case GFX_COPPER_MINE_TOWER_ANIMATED:
+ case GFX_GOLD_MINE_TOWER_ANIMATED:
+ SetIndustryAnimationState(tile_cur, _m[tile_cur].m1);
+ break;
+
+ default: /* No animation states to change */
+ break;
+ }
+ }
+ } END_TILE_LOOP(tile_cur, MapSizeX(), MapSizeY(), 0)
+ }
+
return true;
}