diff options
author | Darkvater <darkvater@openttd.org> | 2006-03-01 20:38:39 +0000 |
---|---|---|
committer | Darkvater <darkvater@openttd.org> | 2006-03-01 20:38:39 +0000 |
commit | 6e9211fc5a2300c7d6806d159b78365dd2891aff (patch) | |
tree | f6f83dbfcc938258843a25c7728999c2b5278056 | |
parent | 01c371fe0e6d5c1d00972bb2797d84f2cb7d8ae0 (diff) | |
download | openttd-6e9211fc5a2300c7d6806d159b78365dd2891aff.tar.xz |
(svn r3712) - Change the boolean assignment/reading from == 1 to != 0 as suggested by Tron.
-rw-r--r-- | saveload.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/saveload.c b/saveload.c index baf5f2c39..25805eff2 100644 --- a/saveload.c +++ b/saveload.c @@ -406,7 +406,7 @@ uint SlGetFieldLength(void) {return _sl.obj_len;} int64 ReadValue(const void *ptr, VarType conv) { switch (GetVarMemType(conv)) { - case SLE_VAR_BL: return (*(bool*)ptr == 1); + case SLE_VAR_BL: return (*(bool*)ptr != 0); case SLE_VAR_I8: return *(int8* )ptr; case SLE_VAR_U8: return *(byte* )ptr; case SLE_VAR_I16: return *(int16* )ptr; @@ -431,7 +431,7 @@ int64 ReadValue(const void *ptr, VarType conv) void WriteValue(void *ptr, VarType conv, int64 val) { switch (GetVarMemType(conv)) { - case SLE_VAR_BL: *(bool *)ptr = (val == 1); break; + case SLE_VAR_BL: *(bool *)ptr = (val != 0); break; case SLE_VAR_I8: *(int8 *)ptr = val; break; case SLE_VAR_U8: *(byte *)ptr = val; break; case SLE_VAR_I16: *(int16 *)ptr = val; break; |