diff --git a/BauSystem_Main/src/de/steamwar/bausystem/region/FlagStorage.java b/BauSystem_Main/src/de/steamwar/bausystem/region/FlagStorage.java index 8efdb4eb..dbd30203 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/region/FlagStorage.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/region/FlagStorage.java @@ -38,7 +38,11 @@ public class FlagStorage { } public boolean set(final Flag flagType, final Flag.Value value) { - return flags.put(flagType, value) != value; + if (flags.put(flagType, value) != value) { + writeChangedKey(flagType, value); + return true; + } + return false; } @SuppressWarnings("unchecked") @@ -52,4 +56,8 @@ public class FlagStorage { flags.put(flag, flagValue == null ? flag.getDefaultValue() : flag.getFlagValueOf(flagValue.getAsString().toUpperCase())); } } + + private void writeChangedKey(Flag flag, Flag.Value value) { + jsonObject.add(flag.name().toLowerCase(), new JsonPrimitive(value.getValue().getName())); + } } \ No newline at end of file