forked from mirror/OpenTTD
(svn r13821) -Codechange: replace some uint8/bytes with more specificly named typedefs and replace a few magic numbers.
This commit is contained in:
@@ -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;
|
||||
|
@@ -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.
|
||||
|
||||
|
@@ -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
|
||||
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user