fix(mod-api): fail closed on malformed map blocks

This commit is contained in:
Bo Layer
2026-08-23 03:18:17 -06:00
parent 0147e3d87b
commit c9221daa90
3 changed files with 27 additions and 7 deletions
+9 -2
View File
@@ -272,12 +272,19 @@ mod.hooks:wrap("map.occupancy_allowed", function(next, game, ctx)
end)
```
With no wrapper, the hook allocates no context and vanilla behavior is byte-for-
byte unchanged. A throwing wrapper is isolated by the normal hook bus. A nil,
With no wrapper, the hook allocates no context and vanilla behavior is
unchanged. A throwing wrapper is isolated by the normal hook bus. A nil,
string, number, table, or other malformed final answer fails closed. Disabling
or uninstalling the permitting mod therefore restores vanilla ejection without
changing the S.S. Anne story flag or restoring the ship.
Normal hook-chain ownership applies: a wrapper that does not call `next`
intentionally owns the final answer and does not run lower-priority wrappers.
Permission wrappers must call `next` as shown above to compose. A noncompliant
wrapper that returns false without calling `next` safely denies occupancy and
can suppress downstream permission by this standard rule. A malformed answer
also fails closed and cannot force occupancy.
## Party ordering
Companion UIs and alternate party screens can call