Skip to content

Commit

Permalink
Fix npc:<entry[.. type of arguments
Browse files Browse the repository at this point in the history
the code that handles npc: and player: didn't link a ScriptEntry, so
tags that need a ScriptEntry (such as <entry[name].value>) do not work
in that situation.
Specific situation for easy reproduction/testing:
- create spider minispider <player.location> save:myspider
- narrate npc:<entry[myspider].created_npc> "<npc.name>"
(Obviously it's not actually a narrate, but code that actually interacts
with the npc)
  • Loading branch information
mcmonkey4eva committed Nov 8, 2013
1 parent 395019c commit 0ca5aff
Showing 1 changed file with 2 additions and 2 deletions.
Expand Up @@ -124,7 +124,7 @@ public boolean execute(ScriptEntry scriptEntry) {
// Fill player/off-line player
if (arg.matchesPrefix("player") && !if_ignore) {
dB.echoDebug(scriptEntry, "...replacing the linked player with " + arg.getValue());
String value = TagManager.tag(scriptEntry.getPlayer(), scriptEntry.getNPC(), arg.getValue(), false);
String value = TagManager.tag(scriptEntry.getPlayer(), scriptEntry.getNPC(), arg.getValue(), false, scriptEntry);
dPlayer player = dPlayer.valueOf(value);
if (player == null || !player.isValid()) {
dB.echoError(value + " is an invalid player!");
Expand All @@ -136,7 +136,7 @@ public boolean execute(ScriptEntry scriptEntry) {
// Fill NPCID/NPC argument
else if (arg.matchesPrefix("npc, npcid") && !if_ignore) {
dB.echoDebug(scriptEntry, "...replacing the linked NPC with " + arg.getValue());
String value = TagManager.tag(scriptEntry.getPlayer(), scriptEntry.getNPC(), arg.getValue(), false);
String value = TagManager.tag(scriptEntry.getPlayer(), scriptEntry.getNPC(), arg.getValue(), false, scriptEntry);
dNPC npc = dNPC.valueOf(value);
if (npc == null || !npc.isValid()) {
dB.echoError(value + " is an invalid NPC!");
Expand Down

0 comments on commit 0ca5aff

Please sign in to comment.