summaryrefslogtreecommitdiff
path: root/player.h
diff options
context:
space:
mode:
authortron <tron@openttd.org>2005-07-21 19:36:43 +0000
committertron <tron@openttd.org>2005-07-21 19:36:43 +0000
commite53c4db866021b07baace56f999be93920cd0f19 (patch)
tree29fd622967555974430109d40525b6a56175d6c2 /player.h
parent284d9ed7fb9704f043220414efe0886aa2fa158e (diff)
downloadopenttd-e53c4db866021b07baace56f999be93920cd0f19.tar.xz
(svn r2664) Remove depedency on player.h from variables.h
Diffstat (limited to 'player.h')
-rw-r--r--player.h7
1 files changed, 7 insertions, 0 deletions
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