Reconcile script fixes from reference edition
This commit is contained in:
parent
5a0d5d2538
commit
9cad93c764
|
@ -1778,18 +1778,16 @@ int scriptSaveAll(File* stream)
|
||||||
for (int index = 0; index < scriptExtent->length; index++) {
|
for (int index = 0; index < scriptExtent->length; index++) {
|
||||||
Script* script = &(scriptExtent->scripts[index]);
|
Script* script = &(scriptExtent->scripts[index]);
|
||||||
|
|
||||||
|
lastScriptExtent = scriptList->tail;
|
||||||
if ((script->flags & SCRIPT_FLAG_0x08) != 0) {
|
if ((script->flags & SCRIPT_FLAG_0x08) != 0) {
|
||||||
scriptCount--;
|
scriptCount--;
|
||||||
|
|
||||||
lastScriptExtent = scriptList->tail;
|
|
||||||
int backwardsIndex = lastScriptExtent->length - 1;
|
int backwardsIndex = lastScriptExtent->length - 1;
|
||||||
while (lastScriptExtent != scriptExtent || backwardsIndex > index) {
|
if (lastScriptExtent == scriptExtent && backwardsIndex <= index) {
|
||||||
if (lastScriptExtent == scriptExtent) {
|
break;
|
||||||
if (backwardsIndex >= index) {
|
}
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
while (lastScriptExtent != scriptExtent || backwardsIndex > index) {
|
||||||
Script* backwardsScript = &(lastScriptExtent->scripts[backwardsIndex]);
|
Script* backwardsScript = &(lastScriptExtent->scripts[backwardsIndex]);
|
||||||
if ((backwardsScript->flags & SCRIPT_FLAG_0x08) == 0) {
|
if ((backwardsScript->flags & SCRIPT_FLAG_0x08) == 0) {
|
||||||
break;
|
break;
|
||||||
|
@ -2685,7 +2683,7 @@ int scriptGetLocalVar(int sid, int variable, int* value)
|
||||||
}
|
}
|
||||||
|
|
||||||
Script* script;
|
Script* script;
|
||||||
if (scriptGetScript(sid, &script) == 1) {
|
if (scriptGetScript(sid, &script) == -1) {
|
||||||
*value = -1;
|
*value = -1;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue