|
|
@ -50,6 +50,7 @@ protected function Constructor() { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protected function Finalizer() { |
|
|
|
protected function Finalizer() { |
|
|
|
|
|
|
|
_drop(); |
|
|
|
_.memory.Free(completedReplacements); |
|
|
|
_.memory.Free(completedReplacements); |
|
|
|
_.memory.Free(originalScriptCodes); |
|
|
|
_.memory.Free(originalScriptCodes); |
|
|
|
completedReplacements = none; |
|
|
|
completedReplacements = none; |
|
|
@ -57,6 +58,26 @@ protected function Finalizer() { |
|
|
|
functionCaster = none; |
|
|
|
functionCaster = none; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public final function bool _drop() { |
|
|
|
|
|
|
|
local UFunction nextFunctionInstance; |
|
|
|
|
|
|
|
local Text nextFunctionName; |
|
|
|
|
|
|
|
local HashTableIterator iter; |
|
|
|
|
|
|
|
local ByteArrayBox nextSources; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Drop is called when Acedia is shutting down, so releasing references isn't necessary |
|
|
|
|
|
|
|
iter = HashTableIterator(completedReplacements.Iterate()); |
|
|
|
|
|
|
|
while (!iter.HasFinished()) { |
|
|
|
|
|
|
|
nextFunctionName = Text(iter.GetKey()); |
|
|
|
|
|
|
|
nextSources = ByteArrayBox(originalScriptCodes.GetItem(nextFunctionName)); |
|
|
|
|
|
|
|
if (nextSources != none ) { |
|
|
|
|
|
|
|
nextFunctionInstance = FindFunction(nextFunctionName); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (nextFunctionInstance != none) { |
|
|
|
|
|
|
|
nextFunctionInstance.script = nextSources.Get(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/// Reverts the replacement of the function's code, restoring its original behavior. |
|
|
|
/// Reverts the replacement of the function's code, restoring its original behavior. |
|
|
|
/// |
|
|
|
/// |
|
|
|
/// The function to be reverted should be specified using its full path, in the format |
|
|
|
/// The function to be reverted should be specified using its full path, in the format |
|
|
@ -306,7 +327,6 @@ private final function bool _replaceFunction(Text oldFunctionLowerCase, Text new |
|
|
|
_.memory.Free(initialCode); |
|
|
|
_.memory.Free(initialCode); |
|
|
|
} |
|
|
|
} |
|
|
|
replace.script = with.script; |
|
|
|
replace.script = with.script; |
|
|
|
Log("TRULLY!" @ replace @ with); |
|
|
|
|
|
|
|
return true; |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|