From 1a651243bb2c8e18baa9aac30ac52a62185074e7 Mon Sep 17 00:00:00 2001 From: Ben Longbons Date: Sun, 30 Mar 2014 23:14:12 -0700 Subject: Be stricter about most arrays --- src/map/script.cpp | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) (limited to 'src/map/script.cpp') diff --git a/src/map/script.cpp b/src/map/script.cpp index cbb6d96..18055b8 100644 --- a/src/map/script.cpp +++ b/src/map/script.cpp @@ -78,20 +78,20 @@ Map scriptlabel_db; UPMap userfunc_db; static -const char *pos_str[11] = -{ - "Head", - "Body", - "Left hand", - "Right hand", - "Robe", - "Shoes", - "Accessory 1", - "Accessory 2", - "Head 2", - "Head 3", - "Not Equipped", -}; +Array pos_str //= +{{ + ZString("Head"), + ZString("Body"), + ZString("Left hand"), + ZString("Right hand"), + ZString("Robe"), + ZString("Shoes"), + ZString("Accessory 1"), + ZString("Accessory 2"), + ZString("Head 2"), + ZString("Head 3"), + ZString("Not Equipped"), +}}; static struct Script_Config @@ -2202,8 +2202,8 @@ void builtin_strcharinfo(ScriptState *st) // indexed by the equip_* in db/const.txt // TODO change to use EQUIP static -EPOS equip[11] = -{ +Array equip //= +{{ EPOS::HAT, EPOS::MISC1, EPOS::SHIELD, @@ -2215,7 +2215,7 @@ EPOS equip[11] = EPOS::TORSO, EPOS::LEGS, EPOS::ARROW, -}; +}}; /*========================================== * GetEquipID(Pos); Pos: 1-10 @@ -4693,11 +4693,11 @@ void run_script_main(ScriptState *st, const ScriptBuffer *rootscript) */ int run_script(ScriptPointer sp, int rid, int oid) { - return run_script_l(sp, rid, oid, 0, NULL); + return run_script_l(sp, rid, oid, nullptr); } int run_script_l(ScriptPointer sp, int rid, int oid, - int args_nr, argrec_t *args) + Slice args) { struct script_stack stack; ScriptState st; @@ -4717,7 +4717,7 @@ int run_script_l(ScriptPointer sp, int rid, int oid, st.scriptp = sp; st.rid = rid; st.oid = oid; - for (i = 0; i < args_nr; i++) + for (i = 0; i < args.size(); i++) { if (args[i].name.back() == '$') pc_setregstr(sd, SIR::from(variable_names.intern(args[i].name)), args[i].v.s); -- cgit v1.2.3-60-g2f50