summaryrefslogtreecommitdiff
path: root/src/map/script.cpp
diff options
context:
space:
mode:
authorBen Longbons <b.r.longbons@gmail.com>2014-03-30 23:14:12 -0700
committerBen Longbons <b.r.longbons@gmail.com>2014-03-31 10:18:49 -0700
commit1a651243bb2c8e18baa9aac30ac52a62185074e7 (patch)
treedd2c0bfc448faef129fb64edec9f64d2ab12bfe5 /src/map/script.cpp
parent769e8ac9c17779a15492d7fcfc1931c014670c2d (diff)
downloadtmwa-1a651243bb2c8e18baa9aac30ac52a62185074e7.tar.gz
tmwa-1a651243bb2c8e18baa9aac30ac52a62185074e7.tar.bz2
tmwa-1a651243bb2c8e18baa9aac30ac52a62185074e7.tar.xz
tmwa-1a651243bb2c8e18baa9aac30ac52a62185074e7.zip
Be stricter about most arrays
Diffstat (limited to 'src/map/script.cpp')
-rw-r--r--src/map/script.cpp40
1 files changed, 20 insertions, 20 deletions
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, int> scriptlabel_db;
UPMap<RString, const ScriptBuffer> 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<ZString, 11> 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<EPOS, 11> 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<argrec_t> 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);