Skip to content

Commit

Permalink
Actually fix chat event failures
Browse files Browse the repository at this point in the history
  • Loading branch information
Morphan1 committed Mar 6, 2015
1 parent db7384d commit be5fcb7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Expand Up @@ -114,7 +114,9 @@ else if (determination.toUpperCase().startsWith("FORMAT:")) {
String name = determination.substring(7);
FormatScriptContainer format = ScriptRegistry.getScriptContainer(name);
if (format == null) dB.echoError("Could not find format script matching '" + name + '\'');
else event.setFormat(EscapeTags.unEscape(format.getFormattedText(EscapeTags.Escape(event.getMessage()), null, player)));
else event.setFormat(format.getFormattedText(event.getMessage()
.replace("&", "&amp").replace("%", "&pc"), null, player)
.replace("&pc", "%").replace("&amp", "&"));
} else if (!determination.equals("none")) {
event.setMessage(determination);
}
Expand Down
Expand Up @@ -108,7 +108,9 @@ else if (determination.toUpperCase().startsWith("FORMAT:")) {
String name = determination.substring(7);
FormatScriptContainer format = ScriptRegistry.getScriptContainer(name);
if (format == null) dB.echoError("Could not find format script matching '" + name + '\'');
else event.setFormat(EscapeTags.unEscape(format.getFormattedText(EscapeTags.Escape(event.getMessage()), null, player)));
else event.setFormat(format.getFormattedText(event.getMessage()
.replace("&", "&amp").replace("%", "&pc"), null, player)
.replace("&pc", "%").replace("&amp", "&"));
}
else if (!determination.equals("none")) {
event.setMessage(determination);
Expand Down

0 comments on commit be5fcb7

Please sign in to comment.