Revert "pull request #Revert from open-osrs/Revert

Revert "Revert "Revert "Revert "Revert "Revert "Revert "Revert "Revert "Revert "Revert "change scriptvm to be more reliable""
This commit is contained in:
Lucwousin
2020-06-28 15:37:39 +02:00
committed by GitHub
2 changed files with 5 additions and 4 deletions

View File

@@ -18,7 +18,7 @@ plugins {
val oprsver = "3.3.1" val oprsver = "3.3.1"
group = "com.openosrs" group = "com.openosrs"
version = "1.1.3" version = "1.1.4"
repositories { repositories {
mavenCentral() mavenCentral()
@@ -26,6 +26,7 @@ repositories {
maven { maven {
url = uri("https://repo.runelite.net") url = uri("https://repo.runelite.net")
url = uri("https://raw.githubusercontent.com/open-osrs/hosting/master") url = uri("https://raw.githubusercontent.com/open-osrs/hosting/master")
url = uri("https://repo.openosrs.com/repository/maven")
} }
} }

View File

@@ -109,12 +109,12 @@ public class ScriptVM extends AbstractInjector
final Field scriptInstructions = InjectUtil.findField(inject, "opcodes", "Script"); final Field scriptInstructions = InjectUtil.findField(inject, "opcodes", "Script");
final Field scriptStatePC = InjectUtil.findField(inject, "pc", "ScriptFrame"); final Field scriptStatePC = InjectUtil.findField(inject, "pc", "ScriptFrame");
// Next 4 should be injected by mixins, so don't need fail fast
final ClassFile vanillaClient = vanilla.findClass("client"); final ClassFile vanillaClient = vanilla.findClass("client");
// Next 4 should be injected by mixins, so don't need fail fast
final Method runScript = vanillaClient.findStaticMethod("copy$runScript"); final Method runScript = vanillaClient.findStaticMethod("copy$runScript");
final Method vmExecuteOpcode = vanillaClient.findStaticMethod("vmExecuteOpcode"); final Method vmExecuteOpcode = vanillaClient.findStaticMethod("vmExecuteOpcode");
final Field currentScriptField = vanillaClient.findField("currentScript"); final Method setCurrentScript = vanillaClient.findStaticMethod("setCurrentScript");
final Field currentScriptPCField = vanillaClient.findField("currentScriptPC"); final Field currentScriptPCField = vanillaClient.findField("currentScriptPC");
Execution e = new Execution(inject.getVanilla()); Execution e = new Execution(inject.getVanilla());
@@ -242,7 +242,7 @@ public class ScriptVM extends AbstractInjector
{ {
instrIter.previous(); instrIter.previous();
instrIter.add(new Dup(instrs)); instrIter.add(new Dup(instrs));
instrIter.add(new PutStatic(instrs, currentScriptField)); instrIter.add(new InvokeStatic(instrs, setCurrentScript.getPoolMethod()));
instrIter.next(); instrIter.next();
} }
} }