mirror of
https://github.com/ReneLergner/WPinternals.git
synced 2026-06-21 06:31:02 +10:00
Patcher: fix: broken go to labels in script engine
This commit is contained in:
@@ -1487,13 +1487,16 @@ namespace Patcher
|
|||||||
|
|
||||||
if (FindSuccess)
|
if (FindSuccess)
|
||||||
{
|
{
|
||||||
FunctionDescriptor FoundLabel = Labels.Find(l => string.Equals(l.Name, Label, StringComparison.CurrentCultureIgnoreCase));
|
CodeLine NewLine = ScriptCode.Find(l => string.Equals(l.Label, Label, StringComparison.CurrentCultureIgnoreCase));
|
||||||
if (FoundLabel == null)
|
if (NewLine == null)
|
||||||
throw new ScriptExecutionException("Label not found: " + Label);
|
{
|
||||||
|
throw new ScriptExecutionException("Label " + Label + " not found");
|
||||||
WriteLog("Condition was found, jumping to label: " + Label);
|
}
|
||||||
WriteLog("New virtual address: 0x" + FoundLabel.VirtualAddress.ToString("X8"));
|
else
|
||||||
CurrentVirtualAddressTarget = FoundLabel.VirtualAddress;
|
{
|
||||||
|
Pointer = ScriptCode.IndexOf(NewLine);
|
||||||
|
WriteLog("Go to label: " + Label);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1504,13 +1507,16 @@ namespace Patcher
|
|||||||
|
|
||||||
if (!FindSuccess)
|
if (!FindSuccess)
|
||||||
{
|
{
|
||||||
FunctionDescriptor FoundLabel = Labels.Find(l => string.Equals(l.Name, Label, StringComparison.CurrentCultureIgnoreCase));
|
CodeLine NewLine = ScriptCode.Find(l => string.Equals(l.Label, Label, StringComparison.CurrentCultureIgnoreCase));
|
||||||
if (FoundLabel == null)
|
if (NewLine == null)
|
||||||
throw new ScriptExecutionException("Label not found: " + Label);
|
{
|
||||||
|
throw new ScriptExecutionException("Label " + Label + " not found");
|
||||||
WriteLog("Condition was not found, jumping to label: " + Label);
|
}
|
||||||
WriteLog("New virtual address: 0x" + FoundLabel.VirtualAddress.ToString("X8"));
|
else
|
||||||
CurrentVirtualAddressTarget = FoundLabel.VirtualAddress;
|
{
|
||||||
|
Pointer = ScriptCode.IndexOf(NewLine);
|
||||||
|
WriteLog("Go to label: " + Label);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user