Make sure objectives aren't modified in editor
This commit is contained in:
@@ -478,7 +478,9 @@ public class Logic implements ApplicationListener{
|
|||||||
}
|
}
|
||||||
|
|
||||||
//TODO objectives clientside???
|
//TODO objectives clientside???
|
||||||
|
if(!state.isEditor()){
|
||||||
updateObjectives();
|
updateObjectives();
|
||||||
|
}
|
||||||
|
|
||||||
if(state.rules.waves && state.rules.waveTimer && !state.gameOver){
|
if(state.rules.waves && state.rules.waveTimer && !state.gameOver){
|
||||||
if(!isWaitingWave()){
|
if(!isWaitingWave()){
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ import mindustry.*;
|
|||||||
import mindustry.content.*;
|
import mindustry.content.*;
|
||||||
import mindustry.core.GameState.*;
|
import mindustry.core.GameState.*;
|
||||||
import mindustry.game.*;
|
import mindustry.game.*;
|
||||||
|
import mindustry.game.MapObjectives.*;
|
||||||
import mindustry.gen.*;
|
import mindustry.gen.*;
|
||||||
import mindustry.graphics.*;
|
import mindustry.graphics.*;
|
||||||
import mindustry.io.*;
|
import mindustry.io.*;
|
||||||
@@ -325,6 +326,8 @@ public class MapEditorDialog extends Dialog implements Disposable{
|
|||||||
public @Nullable Map save(){
|
public @Nullable Map save(){
|
||||||
boolean isEditor = state.rules.editor;
|
boolean isEditor = state.rules.editor;
|
||||||
state.rules.editor = false;
|
state.rules.editor = false;
|
||||||
|
state.rules.objectiveFlags.clear();
|
||||||
|
state.rules.objectives.each(MapObjective::reset);
|
||||||
String name = editor.tags.get("name", "").trim();
|
String name = editor.tags.get("name", "").trim();
|
||||||
editor.tags.put("rules", JsonIO.write(state.rules));
|
editor.tags.put("rules", JsonIO.write(state.rules));
|
||||||
editor.tags.remove("width");
|
editor.tags.remove("width");
|
||||||
|
|||||||
@@ -118,7 +118,7 @@ public class Rules{
|
|||||||
public ObjectSet<Item> hiddenBuildItems = Items.erekirOnlyItems.asSet();
|
public ObjectSet<Item> hiddenBuildItems = Items.erekirOnlyItems.asSet();
|
||||||
/** Campaign-only map objectives. */
|
/** Campaign-only map objectives. */
|
||||||
public Seq<MapObjective> objectives = new Seq<>();
|
public Seq<MapObjective> objectives = new Seq<>();
|
||||||
/** Flags set by objectives. Used in world processors. */
|
/** Flags set by objectives. Used in world processors. n*/
|
||||||
public ObjectSet<String> objectiveFlags = new ObjectSet<>();
|
public ObjectSet<String> objectiveFlags = new ObjectSet<>();
|
||||||
/** HIGHLY UNSTABLE/EXPERIMENTAL. DO NOT USE THIS. */
|
/** HIGHLY UNSTABLE/EXPERIMENTAL. DO NOT USE THIS. */
|
||||||
public boolean fog = false;
|
public boolean fog = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user