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

Bug Fixes: wandering NPC, Fact Label cleanup, Zombie Fact

parent 801d9791
No related branches found
No related tags found
No related merge requests found
......@@ -18018,6 +18018,12 @@ Transform:
type: 3}
m_PrefabInstance: {fileID: 800121727}
m_PrefabAsset: {fileID: 0}
--- !u!1 &802019337 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 4661435515762455780, guid: e289bf5debb17f6459818c207d781953,
type: 3}
m_PrefabInstance: {fileID: 224606875}
m_PrefabAsset: {fileID: 0}
--- !u!1 &804378691
GameObject:
m_ObjectHideFlags: 0
......@@ -23482,7 +23488,7 @@ PrefabInstance:
- target: {fileID: 2222111361404534124, guid: 88f2fd29f58b9734683512546acec310,
type: 3}
propertyPath: m_Name
value: WalkAroundTree
value: DonTWalkAroundThisTree
objectReference: {fileID: 0}
- target: {fileID: 2222111361405018444, guid: 88f2fd29f58b9734683512546acec310,
type: 3}
......@@ -37123,12 +37129,6 @@ Transform:
type: 3}
m_PrefabInstance: {fileID: 1738591202}
m_PrefabAsset: {fileID: 0}
--- !u!1 &1747050947 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 2222111361404534124, guid: 88f2fd29f58b9734683512546acec310,
type: 3}
m_PrefabInstance: {fileID: 1038096501}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &1749781951
PrefabInstance:
m_ObjectHideFlags: 0
......@@ -61544,7 +61544,7 @@ PrefabInstance:
type: 3}
propertyPath: walkAroundObject
value:
objectReference: {fileID: 1747050947}
objectReference: {fileID: 802019337}
- target: {fileID: 6999573641170124239, guid: 8590393c51194934a95cdc2075fc4dec,
type: 3}
propertyPath: radiusAroundObject
......@@ -122,6 +122,12 @@ public void rename(string newLabel)
public abstract GameObject instantiateDisplay(GameObject prefab, Transform transform);
public static void Clear()
{
MaxLabelId = 0;
UnusedLabelIds.Clear();
}
public virtual void delete(bool keep_clean = true)
{
//TODO: MMT: delete over there
......
......@@ -165,7 +165,8 @@ private void PruneWorkflow()
{
stepnote last = Workflow[i];
if (MetaInf[last.Id].workflow_id == i)
if (last.creation // may be zombie
&& MetaInf[last.Id].workflow_id == i)
// remove for good, if original creation gets pruned
{
this[last.Id].delete();
......@@ -193,9 +194,14 @@ public string Add(Fact value, out bool exists, bool samestep = false)
if (MetaInf[key].workflow_id >= marker)
// check for zombie-status
{
// protect zombie from beeing pruned
var zombie = Workflow[MetaInf[key].workflow_id];
zombie.creation = false;
Workflow[MetaInf[key].workflow_id] = zombie;
// set new init location
MetaInf[key] = new meta(marker, true);
}
// zombies are undead!
else if (MetaInf[key].active)
// desired outcome already achieved
......
......@@ -9,8 +9,6 @@ public class Level : MonoBehaviour
//Solving game parameters
public int minimalSolutionHight;
public static bool solved = false;
void Start()
// Start is called before the first frame update
......@@ -25,11 +23,12 @@ void Start()
LineFact target = new LineFact(buttom.Id, top.Id, SolutionManager);
Solution.Add(SolutionManager[SolutionManager.Add(target, out _, true)]);
Fact.Clear();
}
public static bool gameSolved()
{
solved =
bool solved =
LevelFacts.DynamiclySolved(Solution, out _, out List<Fact> hits, FactComparer: new LineFactHightDirectionComparer());
if (solved)
......
......@@ -12,6 +12,8 @@ public void LevelReset()
// only when generated! (in Level.cs)
CommunicationEvents.SolutionManager.hardreset(false);
Fact.Clear();
SceneManager.LoadSceneAsync(SceneManager.GetActiveScene().buildIndex);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment