Use raw varp array for get/set value in devtools

It was decided the current indirection isn't necessary
This commit is contained in:
Adam
2020-11-30 17:57:17 -05:00
parent 97f4ebf985
commit 38c9e084ed
2 changed files with 4 additions and 24 deletions

View File

@@ -256,7 +256,8 @@ public class DevToolsPlugin extends Plugin
case "getvarp":
{
int varp = Integer.parseInt(args[0]);
int value = client.getVarpValue(client.getVarps(), varp);
int[] varps = client.getVarps();
int value = varps[varp];
client.addChatMessage(ChatMessageType.GAMEMESSAGE, "", "VarPlayer " + varp + ": " + value, null);
break;
}
@@ -264,7 +265,8 @@ public class DevToolsPlugin extends Plugin
{
int varp = Integer.parseInt(args[0]);
int value = Integer.parseInt(args[1]);
client.setVarpValue(client.getVarps(), varp, value);
int[] varps = client.getVarps();
varps[varp] = value;
client.queueChangedVarp(varp);
client.addChatMessage(ChatMessageType.GAMEMESSAGE, "", "Set VarPlayer " + varp + " to " + value, null);
VarbitChanged varbitChanged = new VarbitChanged();