Allow the creation of recursive HTNs (#30138)

Allow recursive HTNs
This commit is contained in:
osjarw
2024-07-30 05:18:53 +03:00
committed by GitHub
parent cc3d6441be
commit 669cc55ba4
4 changed files with 21 additions and 0 deletions

View File

@@ -45,6 +45,10 @@ public sealed class NPCTest
var count = counts.GetOrNew(compound.ID);
count++;
// Compound tasks marked with AllowRecursion are only evaluated once
if (counts.ContainsKey(compound.ID) && compound.AllowRecursion)
continue;
Assert.That(count, Is.LessThan(50));
counts[compound.ID] = count;
Count(protoManager.Index<HTNCompoundPrototype>(compoundTask.Task), counts, htnSystem, protoManager);