Shooting NPCs and more (#18042)
* Add pirate shooting * Shooting working * Basics working * Refactor time * More conversion * Update primitives * Update yml * weh * Building again * Draft * weh * b * Start shutdown * Starting to take form * Code side done * is it worky * Fix prototypes * stuff * Shitty working * Juke events working * Even more cleanup * RTX * Fix interaction combat mode and compquery * GetAmmoCount relays * Fix rotation speed * Juke fixes * fixes * weh * The collision avoidance never ends * Fixes * Pause support * framework * lazy * Fix idling * Fix drip * goobed * Fix takeover shutdown bug * Merge fixes * shitter * Fix carpos
This commit is contained in:
@@ -24,9 +24,9 @@ public sealed class NPCTest
|
||||
{
|
||||
var counts = new Dictionary<string, int>();
|
||||
|
||||
foreach (var compound in protoManager.EnumeratePrototypes<HTNCompoundTask>())
|
||||
foreach (var compound in protoManager.EnumeratePrototypes<HTNCompoundPrototype>())
|
||||
{
|
||||
Count(compound, counts, htnSystem);
|
||||
Count(compound, counts, htnSystem, protoManager);
|
||||
counts.Clear();
|
||||
}
|
||||
});
|
||||
@@ -34,13 +34,11 @@ public sealed class NPCTest
|
||||
await pool.CleanReturnAsync();
|
||||
}
|
||||
|
||||
private static void Count(HTNCompoundTask compound, Dictionary<string, int> counts, HTNSystem htnSystem)
|
||||
private static void Count(HTNCompoundPrototype compound, Dictionary<string, int> counts, HTNSystem htnSystem, IPrototypeManager protoManager)
|
||||
{
|
||||
var compoundBranches = htnSystem.CompoundBranches[compound];
|
||||
|
||||
for (var i = 0; i < compound.Branches.Count; i++)
|
||||
foreach (var branch in compound.Branches)
|
||||
{
|
||||
foreach (var task in compoundBranches[i])
|
||||
foreach (var task in branch.Tasks)
|
||||
{
|
||||
if (task is HTNCompoundTask compoundTask)
|
||||
{
|
||||
@@ -49,7 +47,7 @@ public sealed class NPCTest
|
||||
|
||||
Assert.That(count, Is.LessThan(50));
|
||||
counts[compound.ID] = count;
|
||||
Count(compoundTask, counts, htnSystem);
|
||||
Count(protoManager.Index<HTNCompoundPrototype>(compoundTask.Task), counts, htnSystem, protoManager);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user