diff --git a/doomsday/plugins/hexen/include/acscript.h b/doomsday/plugins/hexen/include/acscript.h index 0697ea5235..b66a91f6ff 100644 --- a/doomsday/plugins/hexen/include/acscript.h +++ b/doomsday/plugins/hexen/include/acscript.h @@ -207,7 +207,7 @@ class ACScriptInterpreter */ AutoStr *scriptDescription(int scriptNumber); - void writeWorldScriptData(de::Writer &to); + void writeWorldScriptData(de::Writer &to) const; void readWorldScriptData(de::Reader &from); void writeMapScriptData(MapStateWriter *msw); @@ -233,7 +233,7 @@ class ACScriptInterpreter int scriptNumber; ///< On the target map. byte args[4]; - void write(Writer *to) const; + void write(de::Writer &to) const; void read(de::Reader &from); }; diff --git a/doomsday/plugins/hexen/src/acscript.cpp b/doomsday/plugins/hexen/src/acscript.cpp index 112f57a0ce..aaae6d4aad 100644 --- a/doomsday/plugins/hexen/src/acscript.cpp +++ b/doomsday/plugins/hexen/src/acscript.cpp @@ -467,17 +467,17 @@ void ACScriptInterpreter::scriptFinished(ACScript *script) Thinker_Remove(&script->thinker); } -void ACScriptInterpreter::writeWorldScriptData(Writer &to) +void ACScriptInterpreter::writeWorldScriptData(de::Writer &to) const { - byte ver = 4; - to << ver; // version byte + to << byte(4); // Version. + // Write the world-global variable namespace. for(int i = 0; i < MAX_ACS_WORLD_VARS; ++i) { to << worldVars[i]; } - // Serialize the deferred task queue. + // Write the deferred task queue. to << _deferredTasksSize; for(int i = 0; i < _deferredTasksSize; ++i) { @@ -489,12 +489,13 @@ void ACScriptInterpreter::readWorldScriptData(de::Reader &from) { byte ver; from >> ver; + // Read the world-global variable namespace. for(int i = 0; i < MAX_ACS_WORLD_VARS; ++i) { from >> worldVars[i]; } - // Deserialize the deferred task queue. + // Read the deferred task queue. clearDeferredTasks(); from >> _deferredTasksSize; if(_deferredTasksSize)