summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortron <tron@openttd.org>2005-08-13 16:23:07 +0000
committertron <tron@openttd.org>2005-08-13 16:23:07 +0000
commit64ac03f9dc330252fba4deb1ab4813c17f67b1c2 (patch)
tree231be8eb5f3c4e89eb5c382b4d0f385514db5f03
parent765fc0bbc6fe8743db936cd69bbc49593c1d8382 (diff)
downloadopenttd-64ac03f9dc330252fba4deb1ab4813c17f67b1c2.tar.xz
(svn r2862) Return a proper version number, when testing the TTDPatch version in the SkipIf action. Pretend to be version 2.0.1 alpha 49 for now.
Also change the type of the variables, which get compared, to uint32, because the values are at most 32bits wide and always seem to be unsigned.
-rw-r--r--newgrf.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/newgrf.c b/newgrf.c
index 069a35a71..58483c167 100644
--- a/newgrf.c
+++ b/newgrf.c
@@ -1692,7 +1692,8 @@ static void SkipIf(byte *buf, int len)
uint8 paramsize;
uint8 condtype;
uint8 numsprites;
- int param_val = 0, cond_val = 0;
+ uint32 param_val = 0;
+ uint32 cond_val = 0;
bool result;
check_length(len, 6, "SkipIf");
@@ -1730,9 +1731,16 @@ static void SkipIf(byte *buf, int len)
case 0x88: { /* see if specified GRFID is active */
param_val = (GetFileByGRFID(cond_val) != NULL);
} break;
- case 0x8B: /* TTDPatch version */
- param_val = 0xFFFF;
+
+ case 0x8B: { /* TTDPatch version */
+ uint major = 2;
+ uint minor = 0;
+ uint revision = 10; // special case: 2.0.1 is 2.0.10
+ uint build = 49;
+ param_val = (major << 24) | (minor << 20) | (revision << 16) | (build * 10);
break;
+ }
+
case 0x8D: /* TTD Version, 00=DOS, 01=Windows */
param_val = 1;
break;