summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
authorBen Longbons <b.r.longbons@gmail.com>2013-06-26 15:54:58 -0700
committerBen Longbons <b.r.longbons@gmail.com>2013-06-26 15:54:58 -0700
commitbc54555da122ae950578fd0ce57596a3569c4885 (patch)
treedeca2883c706376dc86fc2d8a36d8c93e8ebb6f4 /src/map
parent051e92e4246634d256651903c8c097a89857fba8 (diff)
downloadtmwa-bc54555da122ae950578fd0ce57596a3569c4885.tar.gz
tmwa-bc54555da122ae950578fd0ce57596a3569c4885.tar.bz2
tmwa-bc54555da122ae950578fd0ce57596a3569c4885.tar.xz
tmwa-bc54555da122ae950578fd0ce57596a3569c4885.zip
Add missing PARAM bytecode handler
Diffstat (limited to 'src/map')
-rw-r--r--src/map/script.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/map/script.cpp b/src/map/script.cpp
index 5261a47..64cddd0 100644
--- a/src/map/script.cpp
+++ b/src/map/script.cpp
@@ -879,10 +879,10 @@ void get_val(ScriptState *st, struct script_data *data)
if (data->type == ByteCode::PARAM_)
{
if ((sd = script_rid2sd(st)) == NULL)
- PRINTF("get_val error param SP::%d\n", data->u.numi);
+ PRINTF("get_val error param SP::%d\n", data->u.reg.sp());
data->type = ByteCode::INT;
if (sd)
- data->u.numi = pc_readparam(sd, static_cast<SP>(data->u.numi));
+ data->u.numi = pc_readparam(sd, data->u.reg.sp());
}
else if (data->type == ByteCode::VARIABLE)
{
@@ -973,6 +973,7 @@ void set_reg(dumb_ptr<map_session_data> sd, ByteCode type, SIR reg, struct scrip
{
if (type == ByteCode::PARAM_)
{
+ assert (vd.type == ByteCode::INT);
int val = vd.u.numi;
pc_setparam(sd, reg.sp(), val);
return;
@@ -4552,6 +4553,7 @@ void run_script_main(ScriptState *st, const ScriptBuffer *rootscript)
case ByteCode::POS:
case ByteCode::VARIABLE:
case ByteCode::FUNC_REF:
+ case ByteCode::PARAM_:
// Note that these 3 have *very* different meanings,
// despite being encoded similarly.
{
@@ -4570,6 +4572,10 @@ void run_script_main(ScriptState *st, const ScriptBuffer *rootscript)
case ByteCode::FUNC_REF:
push_int(stack, ByteCode::FUNC_REF, arg);
break;
+ case ByteCode::PARAM_:
+ SP arg_sp = static_cast<SP>(arg);
+ push_reg(stack, ByteCode::PARAM_, SIR::from(arg_sp));
+ break;
}
}
break;