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???
|
||||
updateObjectives();
|
||||
if(!state.isEditor()){
|
||||
updateObjectives();
|
||||
}
|
||||
|
||||
if(state.rules.waves && state.rules.waveTimer && !state.gameOver){
|
||||
if(!isWaitingWave()){
|
||||
|
||||
@@ -19,6 +19,7 @@ import mindustry.*;
|
||||
import mindustry.content.*;
|
||||
import mindustry.core.GameState.*;
|
||||
import mindustry.game.*;
|
||||
import mindustry.game.MapObjectives.*;
|
||||
import mindustry.gen.*;
|
||||
import mindustry.graphics.*;
|
||||
import mindustry.io.*;
|
||||
@@ -325,6 +326,8 @@ public class MapEditorDialog extends Dialog implements Disposable{
|
||||
public @Nullable Map save(){
|
||||
boolean isEditor = state.rules.editor;
|
||||
state.rules.editor = false;
|
||||
state.rules.objectiveFlags.clear();
|
||||
state.rules.objectives.each(MapObjective::reset);
|
||||
String name = editor.tags.get("name", "").trim();
|
||||
editor.tags.put("rules", JsonIO.write(state.rules));
|
||||
editor.tags.remove("width");
|
||||
|
||||
@@ -118,7 +118,7 @@ public class Rules{
|
||||
public ObjectSet<Item> hiddenBuildItems = Items.erekirOnlyItems.asSet();
|
||||
/** Campaign-only map objectives. */
|
||||
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<>();
|
||||
/** HIGHLY UNSTABLE/EXPERIMENTAL. DO NOT USE THIS. */
|
||||
public boolean fog = false;
|
||||
|
||||
Reference in New Issue
Block a user