summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--clear_cmd.c1
-rw-r--r--gfx.c1
-rw-r--r--landscape.c1
-rw-r--r--player.h7
-rw-r--r--players.c2
-rw-r--r--signs.c1
-rw-r--r--station.h1
-rw-r--r--terraform_gui.c1
-rw-r--r--variables.h6
-rw-r--r--vehicle.h3
-rw-r--r--vehicle_gui.c1
-rw-r--r--widget.c1
-rw-r--r--window.c1
13 files changed, 18 insertions, 9 deletions
diff --git a/clear_cmd.c b/clear_cmd.c
index b940af4ab..34ea9e0f7 100644
--- a/clear_cmd.c
+++ b/clear_cmd.c
@@ -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"
diff --git a/gfx.c b/gfx.c
index 57e655c8b..22ff3f943 100644
--- a/gfx.c
+++ b/gfx.c
@@ -1,5 +1,6 @@
#include "stdafx.h"
#include "openttd.h"
+#include "player.h"
#include "spritecache.h"
#include "strings.h"
#include "string.h"
diff --git a/landscape.c b/landscape.c
index b1de88086..dd029560e 100644
--- a/landscape.c
+++ b/landscape.c
@@ -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"
diff --git a/player.h b/player.h
index 43af5b361..609dc25ad 100644
--- a/player.h
+++ b/player.h
@@ -196,8 +196,12 @@ void AiDoGameLoop(Player *p);
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 @@ static inline bool HasRailtypeAvail(Player *p, RailType Railtype)
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
diff --git a/players.c b/players.c
index 6fb7e5cd5..971473480 100644
--- a/players.c
+++ b/players.c
@@ -16,6 +16,8 @@
#include "sound.h"
#include "network.h"
+PlayerID _current_player;
+
extern void StartupEconomy(void);
static const SpriteID cheeks_table[4] = {
diff --git a/signs.c b/signs.c
index 840620ec7..c640ad2cb 100644
--- a/signs.c
+++ b/signs.c
@@ -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"
diff --git a/station.h b/station.h
index 37f8c64fd..9fe13119c 100644
--- a/station.h
+++ b/station.h
@@ -1,6 +1,7 @@
#ifndef STATION_H
#define STATION_H
+#include "player.h"
#include "pool.h"
#include "sprite.h"
#include "tile.h"
diff --git a/terraform_gui.c b/terraform_gui.c
index ee1f082f7..c5e5caf00 100644
--- a/terraform_gui.c
+++ b/terraform_gui.c
@@ -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"
diff --git a/variables.h b/variables.h
index 7e116f5b6..bdc8752d0 100644
--- a/variables.h
+++ b/variables.h
@@ -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 int _timer_counter;
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 StringID _error_message_2;
VARDEF int32 _additional_cash_required;
VARDEF uint32 _decode_parameters[20];
-VARDEF PlayerID _current_player;
VARDEF int _docommand_recursive;
diff --git a/vehicle.h b/vehicle.h
index 5e40d7772..f396ccd5a 100644
--- a/vehicle.h
+++ b/vehicle.h
@@ -435,9 +435,6 @@ static inline Vehicle *GetFirstVehicleFromSharedList(Vehicle *v)
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];
diff --git a/vehicle_gui.c b/vehicle_gui.c
index 9e44c59b7..5955e52ac 100644
--- a/vehicle_gui.c
+++ b/vehicle_gui.c
@@ -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"
diff --git a/widget.c b/widget.c
index 3d0d0a796..39f1b5642 100644
--- a/widget.c
+++ b/widget.c
@@ -1,5 +1,6 @@
#include "stdafx.h"
#include "openttd.h"
+#include "player.h"
#include "table/sprites.h"
#include "table/strings.h"
#include "window.h"
diff --git a/window.c b/window.c
index 51e36ffdf..392f1d5ad 100644
--- a/window.c
+++ b/window.c
@@ -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"