diff options
author | Ben Longbons <b.r.longbons@gmail.com> | 2014-03-30 23:14:12 -0700 |
---|---|---|
committer | Ben Longbons <b.r.longbons@gmail.com> | 2014-03-31 10:18:49 -0700 |
commit | 1a651243bb2c8e18baa9aac30ac52a62185074e7 (patch) | |
tree | dd2c0bfc448faef129fb64edec9f64d2ab12bfe5 /src/map/npc.cpp | |
parent | 769e8ac9c17779a15492d7fcfc1931c014670c2d (diff) | |
download | tmwa-1a651243bb2c8e18baa9aac30ac52a62185074e7.tar.gz tmwa-1a651243bb2c8e18baa9aac30ac52a62185074e7.tar.bz2 tmwa-1a651243bb2c8e18baa9aac30ac52a62185074e7.tar.xz tmwa-1a651243bb2c8e18baa9aac30ac52a62185074e7.zip |
Be stricter about most arrays
Diffstat (limited to 'src/map/npc.cpp')
-rw-r--r-- | src/map/npc.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/map/npc.cpp b/src/map/npc.cpp index dd75691..514c042 100644 --- a/src/map/npc.cpp +++ b/src/map/npc.cpp @@ -200,7 +200,7 @@ void npc_timer_event(NpcEvent eventname) */ static void npc_event_doall_sub(NpcEvent key, struct event_data *ev, - int *c, ScriptLabel name, int rid, int argc, argrec_t *argv) + int *c, ScriptLabel name, int rid, Slice<argrec_t> argv) { ScriptLabel p = key.label; @@ -209,45 +209,45 @@ void npc_event_doall_sub(NpcEvent key, struct event_data *ev, if (name == p) { run_script_l(ScriptPointer(ev->nd->scr.script.get(), ev->pos), rid, ev->nd->bl_id, - argc, argv); + argv); (*c)++; } } -int npc_event_doall_l(ScriptLabel name, int rid, int argc, argrec_t *args) +int npc_event_doall_l(ScriptLabel name, int rid, Slice<argrec_t> args) { int c = 0; for (auto& pair : ev_db) - npc_event_doall_sub(pair.first, &pair.second, &c, name, rid, argc, args); + npc_event_doall_sub(pair.first, &pair.second, &c, name, rid, args); return c; } static void npc_event_do_sub(NpcEvent key, struct event_data *ev, - int *c, NpcEvent name, int rid, int argc, argrec_t *argv) + int *c, NpcEvent name, int rid, Slice<argrec_t> argv) { nullpo_retv(ev); if (name == key) { run_script_l(ScriptPointer(ev->nd->scr.script.get(), ev->pos), rid, ev->nd->bl_id, - argc, argv); + argv); (*c)++; } } -int npc_event_do_l(NpcEvent name, int rid, int argc, argrec_t *args) +int npc_event_do_l(NpcEvent name, int rid, Slice<argrec_t> args) { int c = 0; if (!name.npc) { - return npc_event_doall_l(name.label, rid, argc, args); + return npc_event_doall_l(name.label, rid, args); } for (auto& pair : ev_db) - npc_event_do_sub(pair.first, &pair.second, &c, name, rid, argc, args); + npc_event_do_sub(pair.first, &pair.second, &c, name, rid, args); return c; } |