From e36dc34d8f0969ac4d2bb97b3cbcf083389a1c98 Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Sun, 24 Apr 2011 17:16:13 +0000 Subject: [PATCH] - Fixed: When loading FBehavior::SerializeVarSet() would only zero the variables if there were non-zero variables to load. This was fine when all variables defaulted to zero, but map variables have been able to default to something else for some time now. This meant that if all map variables were zero when the game was saved, they would be restored to their default values when the game was loaded. SVN r3190 (trunk) --- src/p_acs.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/p_acs.cpp b/src/p_acs.cpp index 8598c9aeb..07b1662be 100644 --- a/src/p_acs.cpp +++ b/src/p_acs.cpp @@ -936,6 +936,8 @@ void FBehavior::SerializeVarSet (FArchive &arc, SDWORD *vars, int max) { SDWORD truelast; + memset (vars, 0, max*sizeof(*vars)); + arc << last; if (last == 0) { @@ -950,8 +952,6 @@ void FBehavior::SerializeVarSet (FArchive &arc, SDWORD *vars, int max) last = max; } - memset (vars, 0, max*sizeof(*vars)); - while (first < last) { arc << vars[first];