mirror of https://github.com/OpenTTD/OpenTTD.git
(svn r13376) -Feature: Add access to current long year and date from Action 7/9/D and VarAction2 (23/24 or A3/A4)
Add access to (long format) building year, in Variational Action2 Variable 49 for Vehicles
This commit is contained in:
parent
c7a9637834
commit
2550f353e9
|
@ -3648,6 +3648,14 @@ bool GetGlobalVariable(byte param, uint32 *value)
|
||||||
*value = _settings_game.difficulty.diff_level;
|
*value = _settings_game.difficulty.diff_level;
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
case 0x23: // long format date
|
||||||
|
*value = _date;
|
||||||
|
return true;
|
||||||
|
|
||||||
|
case 0x24: // long format year
|
||||||
|
*value = _cur_year;
|
||||||
|
return true;
|
||||||
|
|
||||||
default: return false;
|
default: return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -616,6 +616,7 @@ static uint32 VehicleGetVariable(const ResolverObject *object, byte variable, by
|
||||||
}
|
}
|
||||||
|
|
||||||
case 0x48: return GetEngine(v->engine_type)->flags; // Vehicle Type Info
|
case 0x48: return GetEngine(v->engine_type)->flags; // Vehicle Type Info
|
||||||
|
case 0x49: return v->build_year;
|
||||||
|
|
||||||
/* Variables which use the parameter */
|
/* Variables which use the parameter */
|
||||||
case 0x60: // Count consist's engine ID occurance
|
case 0x60: // Count consist's engine ID occurance
|
||||||
|
|
Loading…
Reference in New Issue