From f4775d06bb53f927ad05c7e6344a4e839c884c44 Mon Sep 17 00:00:00 2001 From: rubidium Date: Sun, 21 Oct 2007 14:59:05 +0000 Subject: (svn r11330) -Add: OTTD version checking for NewGRFs. This allows NewGRFs to do something different for different versions of OpenTTD, like disabling it for too low versions or loading different graphics. --- src/newgrf.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/newgrf.cpp') diff --git a/src/newgrf.cpp b/src/newgrf.cpp index 307fc48ed..3cf4334ec 100644 --- a/src/newgrf.cpp +++ b/src/newgrf.cpp @@ -3424,6 +3424,11 @@ static uint32 GetParamVal(byte param, uint32 *cond_val) case 0x9E: // Miscellaneous GRF features return _misc_grf_features; + case 0xA1: { // OpenTTD version + extern uint32 _openttd_newgrf_version; + return _openttd_newgrf_version; + } + default: /* GRF Parameter */ if (param < 0x80) return _cur_grffile->param[param]; @@ -3790,7 +3795,8 @@ static void GRFLoadError(byte *buf, int len) STR_NEWGRF_ERROR_UNSET_SWITCH, STR_NEWGRF_ERROR_INVALID_PARAMETER, STR_NEWGRF_ERROR_LOAD_BEFORE, - STR_NEWGRF_ERROR_LOAD_AFTER + STR_NEWGRF_ERROR_LOAD_AFTER, + STR_NEWGRF_ERROR_OTTD_VERSION_NUMBER, }; static const StringID sevstr[] = { -- cgit v1.2.3-54-g00ecf