fix: an event's teardown removes a boss's adds (D287)
All checks were successful
PR Checks / plugin-checks (pull_request) Successful in -1m33s
All checks were successful
PR Checks / plugin-checks (pull_request) Successful in -1m33s
The walk found an event run's boss adds outliving the run: teardown removes what a step placed by net id, and the adds RunicNPC spawned for a boss's phase are in no step's ledger. RunicNPC now keeps each boss's live adds by the boss's net id, after the boss dies too, and RunicNpc_Despawn(<boss net id>) removes them with it, which is the call the bridge's teardown makes. An add leaves the set when it dies. Walked on the Oxide rig: event 36, run 65 placed the boss, its phase summoned two adds owned by run:65, the boss was killed, the event advanced on rust.boss.killed, and the run's cleanup removed both adds. New harness check s6.boss.despawnTakesAdds. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01E14m6SuuY6i1vASFeGDBeY
This commit is contained in:
@@ -2218,12 +2218,17 @@ namespace Oxide.Plugins
|
||||
if (second != null) Api<int>("RunicNpc_Despawn", Id(second));
|
||||
|
||||
// The kill: the death hook with every player who hurt it; the adds fight on (D287).
|
||||
ulong bossId = Id(boss);
|
||||
boss.Hurt(new HitInfo(shooter, boss, Rust.DamageType.Bullet, 5000f));
|
||||
yield return new WaitForSeconds(1f);
|
||||
Check("s6.boss.died", _bossEvents.Contains("died:t_boss") && _bossContributors.ContainsKey(StandInId + 64) && _bossContributors[StandInId + 64] > 990f,
|
||||
$"events {string.Join(", ", _bossEvents.ToArray())}, contributors {JsonConvert.SerializeObject(_bossContributors)}");
|
||||
int addsLeft = List(Owner).Count(d => (string)d["profile"] == "t_roam");
|
||||
Check("s6.boss.addsFightOn", addsLeft == 2, $"{addsLeft} add(s) alive after the boss died (D287)");
|
||||
// An event's teardown despawns what its step placed, by net id: the dead boss's id takes its adds with it.
|
||||
int removed = Api<int>("RunicNpc_Despawn", bossId);
|
||||
int addsAfter = List(Owner).Count(d => (string)d["profile"] == "t_roam");
|
||||
Check("s6.boss.despawnTakesAdds", removed == 2 && addsAfter == 0, $"RunicNpc_Despawn(the dead boss's id) removed {removed}; adds left {addsAfter}");
|
||||
Check("s6.boss.unlisted", List(Owner).All(d => (string)d["profile"] != "t_boss"), "");
|
||||
|
||||
// ---- the examples (D280, D284, D289) ----
|
||||
|
||||
Reference in New Issue
Block a user