diff options
author | rubidium <rubidium@openttd.org> | 2007-10-21 14:59:05 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2007-10-21 14:59:05 +0000 |
commit | f4775d06bb53f927ad05c7e6344a4e839c884c44 (patch) | |
tree | 2808064f7264f726364aadc0c5869eb17d794970 /src/newgrf.cpp | |
parent | 93303cffc453d8cd99b4a1e00645c072e7f7fae3 (diff) | |
download | openttd-f4775d06bb53f927ad05c7e6344a4e839c884c44.tar.xz |
(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.
Diffstat (limited to 'src/newgrf.cpp')
-rw-r--r-- | src/newgrf.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
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[] = { |