summaryrefslogtreecommitdiff
path: root/src/map/magic-expr.cpp
diff options
context:
space:
mode:
authorBen Longbons <b.r.longbons@gmail.com>2013-06-18 20:03:57 -0700
committerBen Longbons <b.r.longbons@gmail.com>2013-06-18 20:11:16 -0700
commit83db3bbee4e19e7426a32ee89ad6c2d8e48260f2 (patch)
treea6fb6f6b6acaa09d5a43cd669f87c2f7f519a521 /src/map/magic-expr.cpp
parent8b5370313dcc00a45ea5c3e8b4c497bc00fd8e13 (diff)
downloadtmwa-83db3bbee4e19e7426a32ee89ad6c2d8e48260f2.tar.gz
tmwa-83db3bbee4e19e7426a32ee89ad6c2d8e48260f2.tar.bz2
tmwa-83db3bbee4e19e7426a32ee89ad6c2d8e48260f2.tar.xz
tmwa-83db3bbee4e19e7426a32ee89ad6c2d8e48260f2.zip
Also poison memcpy, memmove, and memset
Diffstat (limited to 'src/map/magic-expr.cpp')
-rw-r--r--src/map/magic-expr.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/map/magic-expr.cpp b/src/map/magic-expr.cpp
index 7739847..4946de8 100644
--- a/src/map/magic-expr.cpp
+++ b/src/map/magic-expr.cpp
@@ -144,7 +144,7 @@ void stringify(val_t *v, int within_op)
case TYPE::LOCATION:
buf = STRPRINTF("<\"%s\", %d, %d>",
- v->v.v_location.m->name,
+ v->v.v_location.m->name_,
v->v.v_location.x,
v->v.v_location.y);
break;
@@ -736,7 +736,7 @@ int fun_hash_entity(dumb_ptr<env_t>, val_t *result, const_array<val_t> args)
}
int // ret -1: not a string, ret 1: no such item, ret 0: OK
-magic_find_item(const_array<val_t> args, int index, struct item *item, int *stackable)
+magic_find_item(const_array<val_t> args, int index, struct item *item_, int *stackable)
{
struct item_data *item_data;
int must_add_sequentially;
@@ -761,9 +761,9 @@ magic_find_item(const_array<val_t> args, int index, struct item *item, int *stac
if (stackable)
*stackable = !must_add_sequentially;
- memset(item, 0, sizeof(struct item));
- item->nameid = item_data->nameid;
- item->identify = 1;
+ *item_ = item();
+ item_->nameid = item_data->nameid;
+ item_->identify = 1;
return 0;
}
@@ -1064,7 +1064,7 @@ static
int fun_is_exterior(dumb_ptr<env_t>, val_t *result, const_array<val_t> args)
{
#warning "Evil assumptions!"
- RESULTINT = ARGLOCATION(0).m->name[4] == '1';
+ RESULTINT = ARGLOCATION(0).m->name_[4] == '1';
return 0;
}
@@ -1127,7 +1127,7 @@ static
int fun_map_level(dumb_ptr<env_t>, val_t *result, const_array<val_t> args)
{
#warning "Evil assumptions!"
- RESULTINT = ARGLOCATION(0).m->name[4] - '0';
+ RESULTINT = ARGLOCATION(0).m->name_[4] - '0';
return 0;
}
@@ -1135,7 +1135,7 @@ static
int fun_map_nr(dumb_ptr<env_t>, val_t *result, const_array<val_t> args)
{
#warning "Evil assumptions!"
- const char *mapname = ARGLOCATION(0).m->name;
+ const char *mapname = ARGLOCATION(0).m->name_;
RESULTINT = ((mapname[0] - '0') * 100)
+ ((mapname[1] - '0') * 10) + ((mapname[2] - '0'));