static void npc_event_do_sub(NpcEvent key, struct event_data *ev, int *c, NpcEvent name, BlockId rid, Slice<argrec_t> argv) { nullpo_retv(ev); if (name == key) { run_script_l(ScriptPointer(borrow(*ev->nd->scr.script), ev->pos), rid, ev->nd->bl_id, argv); (*c)++; } }
/*========================================== * 全てのNPCのOn*イベント実行 *------------------------------------------ */ static void npc_event_doall_sub(NpcEvent key, struct event_data *ev, int *c, ScriptLabel name, BlockId rid, Slice<argrec_t> argv) { ScriptLabel p = key.label; nullpo_retv(ev); if (name == p) { if (ev->nd->scr.parent != BlockId()) return; // temporary npcs only respond to commands directly issued to them run_script_l(ScriptPointer(script_or_parent(ev->nd), ev->pos), rid, ev->nd->bl_id, argv); (*c)++; } }