mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-08-23 22:49:09 +00:00
(svn r3059) Use bitfields to encode railtype and climates of engines instead of manual shifting/anding
This commit is contained in:
4
engine.c
4
engine.c
@@ -183,7 +183,7 @@ void StartupEngines(void)
|
||||
uint32 r;
|
||||
|
||||
e->age = 0;
|
||||
e->railtype = ei->railtype_climates >> 4;
|
||||
e->railtype = ei->railtype;
|
||||
e->flags = 0;
|
||||
e->player_avail = 0;
|
||||
|
||||
@@ -217,7 +217,7 @@ void StartupEngines(void)
|
||||
e->lifelength = ei->lifelength + _patches.extend_vehicle_life;
|
||||
|
||||
// prevent certain engines from ever appearing.
|
||||
if (!HASBIT(ei->railtype_climates, _opt.landscape)) {
|
||||
if (!HASBIT(ei->climates, _opt.landscape)) {
|
||||
e->flags |= ENGINE_AVAILABLE;
|
||||
e->player_avail = 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user