Skip to content

Commit

Permalink
Fix logical error when removing elements inside a flag array.
Browse files Browse the repository at this point in the history
  • Loading branch information
aufdemrand committed Oct 7, 2013
1 parent 5749f71 commit 598b484
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/java/net/aufdemrand/denizen/flags/FlagManager.java
Expand Up @@ -329,7 +329,8 @@ public void remove(Object obj, int index) {
}

// Else, remove specified index
} else if (index < size()) value.values.remove(index - 1);
} else if (index <= size()) value.values.remove(index - 1);

save();
rebuild();
}
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/net/aufdemrand/denizen/tags/TagManager.java
Expand Up @@ -133,10 +133,12 @@ public static String tag(dPlayer player, dNPC npc, String arg, boolean instant,
// Find new TAG
positions = locateTag(arg);
} while (positions != null || failsafe < 25);

// Return argument with replacements
arg = arg.replace((char)0x01, '<').replace((char)0x02, '>');
return arg;
}

// Match all < > brackets that don't contain < > inside them
private static Pattern tagRegex = Pattern.compile("<([^<>]+)>");

Expand Down

0 comments on commit 598b484

Please sign in to comment.