Skip to content

Commit

Permalink
Change back the CommandExecuter
Browse files Browse the repository at this point in the history
  • Loading branch information
Morphan1 committed Aug 17, 2013
1 parent 81b70e2 commit 22d48bc
Showing 1 changed file with 5 additions and 6 deletions.
Expand Up @@ -106,13 +106,11 @@ public boolean execute(ScriptEntry scriptEntry) {
m.appendTail(sb);
arg = aH.Argument.valueOf(sb.toString());

dPlayer player = scriptEntry.getPlayer();
dNPC npc = scriptEntry.getNPC();

// Fill player/off-line player
if (arg.matchesPrefix("player")) {
dB.echoDebug("...replacing the linked player.");
String value = TagManager.tag(player, npc, arg.getValue(), false);
dPlayer player = dPlayer.valueOf(arg.getValue());
String value = TagManager.tag(player, scriptEntry.getNPC(), arg.getValue(), false);
if (!player.isValid()) {
dB.echoError(value + " is an invalid player!");
return false;
Expand All @@ -123,12 +121,13 @@ public boolean execute(ScriptEntry scriptEntry) {
// Fill NPCID/NPC argument
else if (arg.matchesPrefix("npc, npcid")) {
dB.echoDebug("...replacing the linked NPC.");
String value = TagManager.tag(player, npc, arg.getValue(), false);
dNPC npc = dNPC.valueOf(arg.getValue());
String value = TagManager.tag(scriptEntry.getPlayer(), npc, arg.getValue(), false);
if (!npc.isValid()) {
dB.echoError(value + " is an invalid NPC!");
return false;
}
scriptEntry.setNPC(dNPC.valueOf(value));
scriptEntry.setNPC(npc);
}

else newArgs.add(arg.getValue());
Expand Down

0 comments on commit 22d48bc

Please sign in to comment.