scriptvm: Fix cast exception
This commit is contained in:
@@ -139,6 +139,15 @@ public abstract class ScriptVMMixin implements RSClient
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
boolean tryParseInt(String value) {
|
||||||
|
try {
|
||||||
|
Integer.parseInt(value);
|
||||||
|
return true;
|
||||||
|
} catch (NumberFormatException e) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Copy("runScript")
|
@Copy("runScript")
|
||||||
static void rs$runScript(RSScriptEvent event, int maxExecutionTime)
|
static void rs$runScript(RSScriptEvent event, int maxExecutionTime)
|
||||||
{
|
{
|
||||||
@@ -168,6 +177,8 @@ public abstract class ScriptVMMixin implements RSClient
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -176,6 +187,8 @@ public abstract class ScriptVMMixin implements RSClient
|
|||||||
ScriptPreFired preFired = new ScriptPreFired(scriptIds.peek()); // peek doesn't remove the top item
|
ScriptPreFired preFired = new ScriptPreFired(scriptIds.peek()); // peek doesn't remove the top item
|
||||||
preFired.setScriptEvent(event);
|
preFired.setScriptEvent(event);
|
||||||
client.getCallbacks().post(ScriptPreFired.class, preFired);
|
client.getCallbacks().post(ScriptPreFired.class, preFired);
|
||||||
|
}
|
||||||
|
catch (ClassCastException ignored) {}
|
||||||
|
|
||||||
rs$runScript(event, maxExecutionTime);
|
rs$runScript(event, maxExecutionTime);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user