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
Branches
No related tags found
No related merge requests found
......@@ -250,6 +250,7 @@ public bool set_record(string record_index)
player_record = player_record_list[record_index].Clone();
player_record.name = record_name;
player_record.solved = false;
store(false);
return true;
}
......@@ -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.solved = false;
store(false);
}
......@@ -522,7 +524,7 @@ public PlayerRecord Clone()
{
var ret = new PlayerRecord(this.name)
{
solved = false, // this.solved,
solved = this.solved,
seconds = this.seconds
};
ret.factState = IJSONsavable<FactOrganizer>.postprocess(this.factState);
......
......@@ -23,7 +23,7 @@ void Start()
private void OnDestroy()
{
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);
}
......
......@@ -224,7 +224,7 @@ public static StageErrorStruct Validate(string category, int id, string name, st
return new StageErrorStruct(
category.Length == 0,
ContainsNumber(category, id, true),
name.Length == 0 || ContainsKey(name, local),
name.Length == 0 || ContainsKey(name, false) || ContainsKey(name, true),
false,
!Worlds.Contains(scene),
local == false,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment