Skip to content
Snippets Groups Projects
Commit 3f422c96 authored by Marco Zimmer's avatar Marco Zimmer
Browse files

+ Bug fixes: No val after reset, Force unique name for savegames

parent 88696d4f
No related branches found
No related tags found
No related merge requests found
...@@ -250,6 +250,7 @@ public bool set_record(string record_index) ...@@ -250,6 +250,7 @@ public bool set_record(string record_index)
player_record = player_record_list[record_index].Clone(); player_record = player_record_list[record_index].Clone();
player_record.name = record_name; player_record.name = record_name;
player_record.solved = false;
store(false); store(false);
return true; return true;
} }
...@@ -281,6 +282,7 @@ public void push_record(double seconds_s = -1, bool force_push = false) ...@@ -281,6 +282,7 @@ public void push_record(double seconds_s = -1, bool force_push = false)
player_record_list.Add(push.name, push); player_record_list.Add(push.name, push);
player_record.solved = false;
store(false); store(false);
} }
...@@ -522,7 +524,7 @@ public PlayerRecord Clone() ...@@ -522,7 +524,7 @@ public PlayerRecord Clone()
{ {
var ret = new PlayerRecord(this.name) var ret = new PlayerRecord(this.name)
{ {
solved = false, // this.solved, solved = this.solved,
seconds = this.seconds seconds = this.seconds
}; };
ret.factState = IJSONsavable<FactOrganizer>.postprocess(this.factState); ret.factState = IJSONsavable<FactOrganizer>.postprocess(this.factState);
......
...@@ -23,7 +23,7 @@ void Start() ...@@ -23,7 +23,7 @@ void Start()
private void OnDestroy() private void OnDestroy()
{ {
StageStatic.SetMode(Mode.Play); // no Mode.Create StageStatic.SetMode(Mode.Play); // no Mode.Create
StageStatic.stage.solution.hardreset(invoke_event: false); // StageStatic.stage.solution.hardreset(invoke_event: false); NO! keep in memory!
StageStatic.stage.factState.hardreset(invoke_event: false); StageStatic.stage.factState.hardreset(invoke_event: false);
} }
......
...@@ -224,7 +224,7 @@ public static StageErrorStruct Validate(string category, int id, string name, st ...@@ -224,7 +224,7 @@ public static StageErrorStruct Validate(string category, int id, string name, st
return new StageErrorStruct( return new StageErrorStruct(
category.Length == 0, category.Length == 0,
ContainsNumber(category, id, true), ContainsNumber(category, id, true),
name.Length == 0 || ContainsKey(name, local), name.Length == 0 || ContainsKey(name, false) || ContainsKey(name, true),
false, false,
!Worlds.Contains(scene), !Worlds.Contains(scene),
local == false, local == false,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment