Skip to main content

Module trigger_table

Module trigger_table 

Source
Expand description

Single source of truth for RuneScript trigger metadata.

Every trigger keyword ([opnpc1,…], [if_button,…], [login,_], …) has the same shape of metadata: a byte discriminant for lookup-key dispatch, an optional preferred subject type for entity resolution, whether its subject should be validated to resolve, and whether it’s a button trigger that participates in pointer-grant logic.

Before this module existed, that metadata was scattered across three separate matches in compiler.rs (the byte table, the is_byte_keyed_trigger whitelist, and the preferred_type selector) plus a 13-arm match in pointer_checker.rs. Adding a trigger meant editing four places, and one of them was the bug shape that silently produced unreachable scripts.

Structs§

TriggerInfo

Functions§

allows_returns
byte
is_button
is_valid_trigger
lookup
names
subject_type
validates_subject