From 0ef8e80667a3cd3d572a50d62ede9aa246e166ac Mon Sep 17 00:00:00 2001 From: Darkvater Date: Wed, 1 Mar 2006 20:38:39 +0000 Subject: (svn r3712) - Change the boolean assignment/reading from == 1 to != 0 as suggested by Tron. --- saveload.c | 4 ++-- 1 file 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; -- cgit v1.2.3-70-g09d2