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 | 0ef8e80667a3cd3d572a50d62ede9aa246e166ac (patch) | |
tree | f6f83dbfcc938258843a25c7728999c2b5278056 | |
parent | f86be948d8c250e1433837d859b7284b5ade7aff (diff) | |
download | openttd-0ef8e80667a3cd3d572a50d62ede9aa246e166ac.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; |