--- a/clear_cmd.c Thu Jul 21 18:44:27 2005 +0000
+++ b/clear_cmd.c Thu Jul 21 19:36:43 2005 +0000
@@ -2,6 +2,7 @@
#include "openttd.h"
#include "table/strings.h"
#include "map.h"
+#include "player.h"
#include "tile.h"
#include "viewport.h"
#include "command.h"
--- a/gfx.c Thu Jul 21 18:44:27 2005 +0000
+++ b/gfx.c Thu Jul 21 19:36:43 2005 +0000
@@ -1,5 +1,6 @@
#include "stdafx.h"
#include "openttd.h"
+#include "player.h"
#include "spritecache.h"
#include "strings.h"
#include "string.h"
--- a/landscape.c Thu Jul 21 18:44:27 2005 +0000
+++ b/landscape.c Thu Jul 21 19:36:43 2005 +0000
@@ -1,6 +1,7 @@
#include "stdafx.h"
#include "openttd.h"
#include "map.h"
+#include "player.h"
#include "spritecache.h"
#include "table/sprites.h"
#include "tile.h"
--- a/player.h Thu Jul 21 18:44:27 2005 +0000
+++ b/player.h Thu Jul 21 19:36:43 2005 +0000
@@ -196,8 +196,12 @@
void UpdatePlayerMoney32(Player *p);
#define FOR_ALL_PLAYERS(p) for(p=_players; p != endof(_players); p++)
+extern PlayerID _current_player;
+
#define MAX_PLAYERS 8
VARDEF Player _players[MAX_PLAYERS];
+// NOSAVE: can be determined from player structs
+VARDEF byte _player_colors[MAX_PLAYERS];
static inline Player* GetPlayer(uint i)
{
@@ -229,6 +233,9 @@
return HASBIT(p->avail_railtypes, Railtype);
}
+/* Validate functions for rail building */
+static inline bool ValParamRailtype(uint32 rail) { return HASBIT(GetPlayer(_current_player)->avail_railtypes, rail);}
+
/** Returns the "best" railtype a player can build.
* As the AI doesn't know what the BEST one is, we
* have our own priority list here. When adding
--- a/players.c Thu Jul 21 18:44:27 2005 +0000
+++ b/players.c Thu Jul 21 19:36:43 2005 +0000
@@ -16,6 +16,8 @@
#include "sound.h"
#include "network.h"
+PlayerID _current_player;
+
extern void StartupEconomy(void);
static const SpriteID cheeks_table[4] = {
--- a/signs.c Thu Jul 21 18:44:27 2005 +0000
+++ b/signs.c Thu Jul 21 19:36:43 2005 +0000
@@ -1,6 +1,7 @@
#include "stdafx.h"
#include "openttd.h"
#include "table/strings.h"
+#include "player.h"
#include "signs.h"
#include "saveload.h"
#include "command.h"
--- a/station.h Thu Jul 21 18:44:27 2005 +0000
+++ b/station.h Thu Jul 21 19:36:43 2005 +0000
@@ -1,6 +1,7 @@
#ifndef STATION_H
#define STATION_H
+#include "player.h"
#include "pool.h"
#include "sprite.h"
#include "tile.h"
--- a/terraform_gui.c Thu Jul 21 18:44:27 2005 +0000
+++ b/terraform_gui.c Thu Jul 21 19:36:43 2005 +0000
@@ -2,6 +2,7 @@
#include "openttd.h"
#include "table/sprites.h"
#include "table/strings.h"
+#include "player.h"
#include "tile.h"
#include "window.h"
#include "gui.h"
--- a/variables.h Thu Jul 21 18:44:27 2005 +0000
+++ b/variables.h Thu Jul 21 19:36:43 2005 +0000
@@ -1,8 +1,6 @@
#ifndef VARIABLES_H
#define VARIABLES_H
-#include "player.h"
-
// ********* START OF SAVE REGION
#if !defined(MAX_PATH)
# define MAX_PATH 260
@@ -265,9 +263,6 @@
VARDEF byte _cur_year;
VARDEF byte _cur_month;
-// NOSAVE: can be determined from player structs
-VARDEF byte _player_colors[MAX_PLAYERS];
-
VARDEF bool _in_state_game_loop;
VARDEF uint32 _frame_counter;
@@ -289,7 +284,6 @@
VARDEF int32 _additional_cash_required;
VARDEF uint32 _decode_parameters[20];
-VARDEF PlayerID _current_player;
VARDEF int _docommand_recursive;
--- a/vehicle.h Thu Jul 21 18:44:27 2005 +0000
+++ b/vehicle.h Thu Jul 21 19:36:43 2005 +0000
@@ -435,9 +435,6 @@
return u;
}
-/* Validate functions for rail building */
-static inline bool ValParamRailtype(uint32 rail) { return HASBIT(GetPlayer(_current_player)->avail_railtypes, rail);}
-
// NOSAVE: Can be regenerated by inspecting the vehicles.
VARDEF VehicleID _vehicle_position_hash[0x1000];
--- a/vehicle_gui.c Thu Jul 21 18:44:27 2005 +0000
+++ b/vehicle_gui.c Thu Jul 21 19:36:43 2005 +0000
@@ -1,6 +1,7 @@
#include "stdafx.h"
#include "openttd.h"
#include "debug.h"
+#include "player.h"
#include "strings.h"
#include "table/sprites.h"
#include "table/strings.h"
--- a/widget.c Thu Jul 21 18:44:27 2005 +0000
+++ b/widget.c Thu Jul 21 19:36:43 2005 +0000
@@ -1,5 +1,6 @@
#include "stdafx.h"
#include "openttd.h"
+#include "player.h"
#include "table/sprites.h"
#include "table/strings.h"
#include "window.h"
--- a/window.c Thu Jul 21 18:44:27 2005 +0000
+++ b/window.c Thu Jul 21 19:36:43 2005 +0000
@@ -2,6 +2,7 @@
#include "openttd.h"
#include "debug.h"
#include "map.h"
+#include "player.h"
#include "window.h"
#include "gfx.h"
#include "viewport.h"