mirror of https://github.com/OpenTTD/OpenTTD
(svn r3565) - Fix: On loading a game, GetPlayerRailtypes() didn't account for the fact that vehicles are introduced a year after their introduction date. This will also relieve possible (rare) network desyncs.
parent
453b30e387
commit
431b09ab79
2
engine.c
2
engine.c
|
@ -428,7 +428,7 @@ void EnginesMonthlyLoop(void)
|
||||||
CalcEngineReliability(e);
|
CalcEngineReliability(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(e->flags & ENGINE_AVAILABLE) && (uint16)(_date - min(_date, 365)) >= e->intro_date) {
|
if (!(e->flags & ENGINE_AVAILABLE) && _date >= (e->intro_date + 365)) {
|
||||||
// Introduce it to all players
|
// Introduce it to all players
|
||||||
NewVehicleAvailable(e);
|
NewVehicleAvailable(e);
|
||||||
} else if (!(e->flags & (ENGINE_AVAILABLE|ENGINE_INTRODUCING)) && _date >= e->intro_date) {
|
} else if (!(e->flags & (ENGINE_AVAILABLE|ENGINE_INTRODUCING)) && _date >= e->intro_date) {
|
||||||
|
|
|
@ -628,7 +628,7 @@ byte GetPlayerRailtypes(PlayerID p)
|
||||||
const EngineInfo *ei = &_engine_info[i];
|
const EngineInfo *ei = &_engine_info[i];
|
||||||
|
|
||||||
if (e->type == VEH_Train && HASBIT(ei->climates, _opt.landscape) &&
|
if (e->type == VEH_Train && HASBIT(ei->climates, _opt.landscape) &&
|
||||||
(HASBIT(e->player_avail, p) || e->intro_date <= _date) &&
|
(HASBIT(e->player_avail, p) || _date >= (e->intro_date + 365)) &&
|
||||||
!(RailVehInfo(i)->flags & RVI_WAGON)) {
|
!(RailVehInfo(i)->flags & RVI_WAGON)) {
|
||||||
assert(e->railtype < RAILTYPE_END);
|
assert(e->railtype < RAILTYPE_END);
|
||||||
SETBIT(rt, e->railtype);
|
SETBIT(rt, e->railtype);
|
||||||
|
|
Loading…
Reference in New Issue