Fix active inputs not cleaned up while batching.

This commit is contained in:
2023-06-22 13:21:01 +08:00
parent a7aff4d625
commit 8955b69cdf

View File

@@ -366,19 +366,19 @@ namespace Cryville.Crtr {
_vect[vec.Key.Source] = tt;
}
Cleanup(proxy.Target, (float)GetSyncedTime(time, handler));
Cleanup(proxy.Target, tt, true);
}
}
}
void Cleanup(Identifier target, float tt, int depth = 0) {
void Cleanup(Identifier target, float tt, bool batching = false, int depth = 0) {
if (depth >= MAX_DEPTH) throw new InputProxyException("Input propagation limit reached\nThe ruleset has invalid input definitions");
var def = _ruleset.inputs[target];
if (def.pass != null) {
foreach (var p in def.pass) {
Cleanup(p.Key, tt, depth + 1);
Cleanup(p.Key, tt, batching, depth + 1);
}
}
else if (_targetActiveCount[target] == 0) {
else if (batching || _targetActiveCount[target] == 0) {
_judge.Cleanup(target, tt);
}
}