diff options
| author | historia <[not public]> | 2026-07-17 19:54:21 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-07-17 19:54:21 -0400 |
| commit | c23c87b56fd568956d263bb8b8c5d26fbd8d01ee (patch) | |
| tree | 58737f94d5417e11a7d94b2a250d28ae05a25c58 /internal/engine | |
| parent | d553a976dd2f899e28dc8e023ee4ca2eb8951c38 (diff) | |
| download | thehouseoficarus-c23c87b56fd568956d263bb8b8c5d26fbd8d01ee.tar.gz | |
feat: add test for mob aggro
Diffstat (limited to 'internal/engine')
| -rw-r--r-- | internal/engine/tick.go | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/internal/engine/tick.go b/internal/engine/tick.go index 251373c..7b9666b 100644 --- a/internal/engine/tick.go +++ b/internal/engine/tick.go @@ -86,17 +86,10 @@ func (e *Engine) Stop() { } } -// processTick fires every due subscriber for the current engine tick. -// -// Subscribers are invoked in ascending subscription-ID order, i.e. the order in -// which they were registered with Subscribe. IDs are allocated monotonically -// (e.nextID++), so subscription order is a stable, deterministic sequence: -// the bootstrap master subscriber (cmd/thoi/main.go) subscribes at startup as -// ID 1 and therefore always fires first each tick, followed by each -// subsequently-registered tick (combat rounds, aggro rolls, scheduled respawns, -// etc.) in the order they registered. This guarantees predictable per-tick -// ordering across runs — critical for features whose behaviour depends on the -// relative ordering of combat resolution vs. movement vs. aggro checks. +// Tick fires every due subscriber synchronously and returns. Subscribers +// are invoked in ascending subscription-ID (registration) order. +func (e *Engine) Tick() { e.processTick() } + func (e *Engine) processTick() { e.mu.Lock() snapshot := make(map[uint64]*subscriber, len(e.subscribers)) |
