From e42952469dadfb3535633c66c881050ac128703c Mon Sep 17 00:00:00 2001 From: historia <[not public]> Date: Mon, 5 Oct 2026 17:05:14 -0400 Subject: fix: gather verbs, walk oom, admin path bypass, roulette refund --- internal/combat/state_test.go | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 internal/combat/state_test.go (limited to 'internal/combat/state_test.go') diff --git a/internal/combat/state_test.go b/internal/combat/state_test.go new file mode 100644 index 0000000..8005ba3 --- /dev/null +++ b/internal/combat/state_test.go @@ -0,0 +1,21 @@ +package combat + +import "testing" + +// Regression: re-entering combat must release the previous mob, or that mob +// stays "in combat" forever and no other player can attack it. +func TestTrackerEnterReleasesPreviousMob(t *testing.T) { + tr := NewTracker() + tr.Enter("alice", "mobA") + tr.Enter("alice", "mobB") + if tr.IsMobInCombat("mobA") { + t.Fatal("mobA still marked in combat after alice switched targets") + } + if !tr.IsMobInCombat("mobB") { + t.Fatal("mobB not marked in combat") + } + tr.Leave("alice") + if tr.IsMobInCombat("mobB") { + t.Fatal("mobB still marked in combat after leave") + } +} -- cgit v1.2.3