From 2550f353e9159d6a63a0ab8cc777e519cfad5b08 Mon Sep 17 00:00:00 2001 From: belugas Date: Wed, 4 Jun 2008 00:17:48 +0000 Subject: (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 --- src/newgrf.cpp | 8 ++++++++ src/newgrf_engine.cpp | 1 + 2 files changed, 9 insertions(+) diff --git a/src/newgrf.cpp b/src/newgrf.cpp index 15fee8335..110182169 100644 --- a/src/newgrf.cpp +++ b/src/newgrf.cpp @@ -3648,6 +3648,14 @@ bool GetGlobalVariable(byte param, uint32 *value) *value = _settings_game.difficulty.diff_level; return true; + case 0x23: // long format date + *value = _date; + return true; + + case 0x24: // long format year + *value = _cur_year; + return true; + default: return false; } } diff --git a/src/newgrf_engine.cpp b/src/newgrf_engine.cpp index e0355d3d4..1b9cc55ca 100644 --- a/src/newgrf_engine.cpp +++ b/src/newgrf_engine.cpp @@ -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 0x49: return v->build_year; /* Variables which use the parameter */ case 0x60: // Count consist's engine ID occurance -- cgit v1.2.3-70-g09d2