mirror of
https://github.com/openmoh/openmohaa.git
synced 2025-04-28 13:47:58 +03:00
Only archive used variables on the local VM stack
This commit is contained in:
parent
e59200a7de
commit
2ac2800ecb
1 changed files with 4 additions and 1 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue