mirror of
https://github.com/bearstonem/openmohaa-vr.git
synced 2026-10-18 07:00:22 +02:00
Only archive used variables on the local VM stack
This commit is contained in:
1 file changed
+4
-1
@@ -235,24 +235,27 @@ void ScriptVMStack::Archive(Archiver& arc)
|
||||
{
|
||||
unsigned int size;
|
||||
unsigned int offset;
|
||||
unsigned int numVars;
|
||||
unsigned int i;
|
||||
|
||||
if (arc.Saving()) {
|
||||
size = stackBottom - localStack;
|
||||
offset = pTop - localStack;
|
||||
numVars = offset + 1;
|
||||
|
||||
arc.ArchiveUnsigned(&size);
|
||||
arc.ArchiveUnsigned(&offset);
|
||||
} else {
|
||||
arc.ArchiveUnsigned(&size);
|
||||
arc.ArchiveUnsigned(&offset);
|
||||
numVars = offset + 1;
|
||||
|
||||
Allocate(size);
|
||||
pTop = localStack + offset;
|
||||
}
|
||||
|
||||
if (localStack) {
|
||||
for (i = 0; i < size; i++) {
|
||||
for (i = 0; i < numVars; i++) {
|
||||
localStack[i].ArchiveInternal(arc);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user