Skip to content

Commit

Permalink
Fix logical issue with Kill Listener when specifying NPC names.
Browse files Browse the repository at this point in the history
  • Loading branch information
aufdemrand committed Oct 16, 2013
1 parent aae683d commit a2b0e18
Showing 1 changed file with 4 additions and 3 deletions.
Expand Up @@ -215,13 +215,14 @@ else if (type == KillType.NPC) {

// Check targets, if any match entity killed, count_it!
for (String target : targets) {
// Check IDs
// Check against a physical NPC object (n@7, n@18, etc.)
if (dNPC.valueOf(target) != null) {
if (dNPC.valueOf(target).getId() == npc.getId())
count_it = true;
}
// Check Names
else if (npc.getName().equalsIgnoreCase(target))
// Cannot be 'else if' since dNPC.valueOf will return true for names now, as well as ids.
// Check against name of NPC (n@fullwall, aufdemrand, etc)... object notation is optional.
if (npc.getName().equalsIgnoreCase(target.toLowerCase().replace("n@", "")))
count_it = true;
}
// If NPC was matched or targets contains '*', increment
Expand Down

0 comments on commit a2b0e18

Please sign in to comment.