openttd.c
branchcustombridgeheads
changeset 5623 ef2a8a524a95
parent 5598 166345600ba9
child 5632 025c3b25f1fd
--- a/openttd.c	Mon Jan 01 16:10:01 2007 +0000
+++ b/openttd.c	Mon Jan 01 16:31:13 2007 +0000
@@ -60,6 +60,7 @@
 #include "rail_map.h"
 #include "road_map.h"
 #include "water_map.h"
+#include "industry_map.h"
 
 #include <stdarg.h>
 
@@ -156,7 +157,7 @@
 		"  -e                  = Start Editor\n"
 		"  -g [savegame]       = Start new/save game immediately\n"
 		"  -G seed             = Set random seed\n"
-		"  -n [ip#player:port] = Start networkgame\n"
+		"  -n [ip:port#player] = Start networkgame\n"
 		"  -D                  = Start dedicated server\n"
 #if !defined(__MORPHOS__) && !defined(__AMIGA__) && !defined(WIN32)
 		"  -f                  = Fork into the background (dedicated only)\n"
@@ -1659,6 +1660,33 @@
 		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;
 }