Allow loading scripts for cards containing commas

This commit is contained in:
drdev
2014-07-18 07:27:01 +00:00
parent 0d8dad2d4f
commit 7ab134bb1a

View File

@@ -77,7 +77,7 @@ public final class CardScriptInfo {
public static CardScriptInfo getScriptFor(String name) { public static CardScriptInfo getScriptFor(String name) {
CardScriptInfo script = allScripts.get(name); CardScriptInfo script = allScripts.get(name);
if (script == null) { //attempt to load script if not previously loaded if (script == null) { //attempt to load script if not previously loaded
String filename = name.toLowerCase().replace(' ', '_').replace('-', '_').replace("'", "") + ".txt"; String filename = name.toLowerCase().replace(' ', '_').replace('-', '_').replace("'", "").replace(",", "") + ".txt";
File file = new File(ForgeConstants.CARD_DATA_DIR + filename.charAt(0) + File.separator + filename); File file = new File(ForgeConstants.CARD_DATA_DIR + filename.charAt(0) + File.separator + filename);
if (file.exists()) { if (file.exists()) {
script = new CardScriptInfo(FileUtil.readFileToString(file), file); script = new CardScriptInfo(FileUtil.readFileToString(file), file);