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];