mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2026-07-24 03:56:43 +00:00
(svn r15765) [0.7] -Backport from trunk:
- Change: [NewGRF] Expose GRF ID of engines in var action property 0x25 (r15739) - Fix: Add Engine::GetDisplayDefaultCapacity() and use it everywhere, so CB 36 is also used everywhere (r15763) - Fix: [Windows] Inlined UTF-8 characters (in the source code) are not handled properly on Eastern versions of Windows so escape them (r15762) - Fix: [Windows] On some system searching a font using its English name fails. So now we search the font using the localised name and use the English name for the final 'validation' only (r15757)
This commit is contained in:
@@ -122,7 +122,8 @@ const GRFFile *GetEngineGRF(EngineID engine)
|
||||
*/
|
||||
uint32 GetEngineGRFID(EngineID engine)
|
||||
{
|
||||
return GetEngineGRF(engine)->grfid;
|
||||
const GRFFile *file = GetEngineGRF(engine);
|
||||
return file == NULL ? 0 : file->grfid;
|
||||
}
|
||||
|
||||
|
||||
@@ -500,6 +501,9 @@ static uint32 VehicleGetVariable(const ResolverObject *object, byte variable, by
|
||||
|
||||
/* Calculated vehicle parameters */
|
||||
switch (variable) {
|
||||
case 0x25: // Get engine GRF ID
|
||||
return GetEngineGRFID(v->engine_type);
|
||||
|
||||
case 0x40: // Get length of consist
|
||||
if (!HasBit(v->cache_valid, 0)) {
|
||||
v->cached_var40 = PositionHelper(v, false);
|
||||
|
||||
Reference in New Issue
Block a user