Fixed two bugs reported by MrMouette

- NPE when adding first stage to a newly created quest
- Chance serialization issues.
This commit is contained in:
Zukero
2015-02-23 23:27:53 +01:00
parent 59d8ad1cdb
commit 327c870b17
3 changed files with 5 additions and 2 deletions

View File

@@ -160,7 +160,8 @@ public abstract class JSONElement extends GameDataElement {
else if (chance.equals(0.1d)) return "1/1000";
else if (chance.equals(0.01d)) return "1/10000";
else {
//TODO Better handling of fractions. Chance description need a complete rehaul in AT.
if (chance.intValue() == chance) return Integer.toString(chance.intValue());
//TODO Better handling of fractions. Chance description need a complete overhaul in AT.
//This part does not output the input content of parseDouble(String s) in the case of fractions.
return chance.toString();
}