summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/engine.cpp6
-rw-r--r--src/engine_base.h4
-rw-r--r--src/player_type.h2
-rw-r--r--src/town.h2
4 files changed, 8 insertions, 6 deletions
diff --git a/src/engine.cpp b/src/engine.cpp
index 6712860f3..ab8aed61d 100644
--- a/src/engine.cpp
+++ b/src/engine.cpp
@@ -342,11 +342,11 @@ void EnginesDailyLoop()
DeleteWindowById(WC_ENGINE_PREVIEW, i);
e->preview_player_rank++;
}
- } else if (e->preview_player_rank != 0xFF) {
+ } else if (e->preview_player_rank != PLAYER_SPECTATOR) {
PlayerID best_player = GetBestPlayer(e->preview_player_rank);
if (best_player == PLAYER_SPECTATOR) {
- e->preview_player_rank = 0xFF;
+ e->preview_player_rank = PLAYER_SPECTATOR;
continue;
}
@@ -419,7 +419,7 @@ static void NewVehicleAvailable(Engine *e)
AddRemoveEngineFromAutoreplaceAndBuildWindows(e->type);
/* Now available for all players */
- e->player_avail = (byte)-1;
+ e->player_avail = (PlayerMask)-1;
/* Do not introduce new rail wagons */
if (IsWagon(index)) return;
diff --git a/src/engine_base.h b/src/engine_base.h
index cff59fcb2..6c018b674 100644
--- a/src/engine_base.h
+++ b/src/engine_base.h
@@ -20,9 +20,9 @@ struct Engine : PoolItem<Engine, EngineID, &_Engine_pool> {
uint16 duration_phase_1, duration_phase_2, duration_phase_3;
byte lifelength;
byte flags;
- uint8 preview_player_rank;
+ PlayerByte preview_player_rank;
byte preview_wait;
- byte player_avail;
+ PlayerMask player_avail;
uint8 image_index; ///< Original vehicle image index
VehicleType type; ///< type, ie VEH_ROAD, VEH_TRAIN, etc.
diff --git a/src/player_type.h b/src/player_type.h
index 79d92f691..0dbd4e687 100644
--- a/src/player_type.h
+++ b/src/player_type.h
@@ -42,6 +42,8 @@ typedef TinyEnumT<Owner> OwnerByte;
typedef Owner PlayerID;
typedef OwnerByte PlayerByte;
+typedef uint8 PlayerMask;
+
struct Player;
typedef uint32 PlayerFace; ///< player face bits, info see in player_face.h
diff --git a/src/town.h b/src/town.h
index dfdb7fbaa..65cfe6cbb 100644
--- a/src/town.h
+++ b/src/town.h
@@ -124,7 +124,7 @@ struct Town : PoolItem<Town, TownID, &_Town_pool> {
byte statues;
/* Player ratings as well as a mask that determines which players have a rating. */
- byte have_ratings;
+ PlayerMask have_ratings;
uint8 unwanted[MAX_PLAYERS]; ///< how many months companies aren't wanted by towns (bribe)
PlayerByte exclusivity; ///< which player has exslusivity
uint8 exclusive_counter; ///< months till the exclusivity expires