summaryrefslogtreecommitdiff
path: root/newgrf.c
diff options
context:
space:
mode:
authorpasky <pasky@openttd.org>2005-03-30 12:27:50 +0000
committerpasky <pasky@openttd.org>2005-03-30 12:27:50 +0000
commit7ff930af04edd97355f8225179fa8e97db111000 (patch)
tree55de4b34d2fa9d04ff6baf88972b95525e48260c /newgrf.c
parent95541fa52daa016786588c05a8ae4f16af45aa92 (diff)
downloadopenttd-7ff930af04edd97355f8225179fa8e97db111000.tar.xz
(svn r2110) - Fix: Fixed test for various flags (e.g. newtrains in usset). result is bool so !! any non-zero values before assigning them to it - they apparently didn't fit. ;-)
Diffstat (limited to 'newgrf.c')
-rw-r--r--newgrf.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/newgrf.c b/newgrf.c
index f8deb9433..bf6df8517 100644
--- a/newgrf.c
+++ b/newgrf.c
@@ -1667,8 +1667,9 @@ static void SkipIf(byte *buf, int len)
return;
}
+ DEBUG(grf, 7) ("Test condtype %d, param %x, condval %x", condtype, param_val, cond_val);
switch (condtype) {
- case 0: result = (param_val & (1 << cond_val));
+ case 0: result = !!(param_val & (1 << cond_val));
break;
case 1: result = !(param_val & (1 << cond_val));
break;
@@ -1681,7 +1682,7 @@ static void SkipIf(byte *buf, int len)
break;
case 5: result = (param_val > cond_val);
break;
- case 6: result = param_val; /* GRFID is active (only for param-num=88) */
+ case 6: result = !!param_val; /* GRFID is active (only for param-num=88) */
break;
case 7: result = !param_val; /* GRFID is not active (only for param-num=88) */
break;