src/engine.cpp
changeset 5587 167d9a91ef02
parent 5584 1111b4d36e35
child 5763 a6029daa547f
--- a/src/engine.cpp	Wed Jan 10 18:44:52 2007 +0000
+++ b/src/engine.cpp	Wed Jan 10 18:56:51 2007 +0000
@@ -129,7 +129,7 @@
 		uint32 r;
 
 		e->age = 0;
-		e->railtype = ei->railtype;
+		e->railtype = (RailType)ei->railtype;
 		e->flags = 0;
 		e->player_avail = 0;
 
@@ -189,7 +189,7 @@
 	SETBIT(e->player_avail, player);
 	SETBIT(p->avail_railtypes, e->railtype);
 
-	e->preview_player = 0xFF;
+	e->preview_player = INVALID_PLAYER;
 	if (player == _local_player) {
 		InvalidateWindowClassesData(WC_BUILD_VEHICLE);
 		InvalidateWindowClasses(WC_REPLACE_VEHICLE);
@@ -217,7 +217,7 @@
 		if (best_player == PLAYER_SPECTATOR) return PLAYER_SPECTATOR;
 
 		SETBIT(mask, best_player);
-	} while (--pp != 0);
+	} while (pp--, pp != 0);
 
 	return best_player;
 }
@@ -242,7 +242,7 @@
 				PlayerID best_player = GetBestPlayer(e->preview_player);
 
 				if (best_player == PLAYER_SPECTATOR) {
-					e->preview_player = 0xFF;
+					e->preview_player = INVALID_PLAYER;
 					continue;
 				}
 
@@ -364,7 +364,7 @@
 
 				// Do not introduce new rail wagons
 				if (!IsWagon(e - _engines))
-					e->preview_player = 1; // Give to the player with the highest rating.
+					e->preview_player = (PlayerID)1; // Give to the player with the highest rating.
 			}
 		}
 	}
@@ -636,7 +636,7 @@
 	SlArray(_engine_name_strings, lengthof(_engine_name_strings), SLE_STRINGID);
 }
 
-const ChunkHandler _engine_chunk_handlers[] = {
+extern const ChunkHandler _engine_chunk_handlers[] = {
 	{ 'ENGN', Save_ENGN,     Load_ENGN,     CH_ARRAY          },
 	{ 'ENGS', LoadSave_ENGS, LoadSave_ENGS, CH_RIFF           },
 	{ 'ERNW', Save_ERNW,     Load_ERNW,     CH_ARRAY | CH_LAST},