summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTezer <tezer123@users.noreply.github.com>2018-03-23 21:35:54 -0400
committergumi <git@gumi.ca>2018-03-23 21:35:54 -0400
commitcfeb9d925d583f3767f512ee554004513abbb69c (patch)
tree8ac0cd718044c3655a5a2edfcffcb00b7003eef9
parent770784082265b83323c2d616ab613ef99b763af9 (diff)
downloadtmwa-cfeb9d925d583f3767f512ee554004513abbb69c.tar.gz
tmwa-cfeb9d925d583f3767f512ee554004513abbb69c.tar.bz2
tmwa-cfeb9d925d583f3767f512ee554004513abbb69c.tar.xz
tmwa-cfeb9d925d583f3767f512ee554004513abbb69c.zip
fix a bug introduced by wushin, which freeyorp highlighted with his previous patchv18.3.23.1
-rw-r--r--src/map/npc.cpp19
1 files changed, 2 insertions, 17 deletions
diff --git a/src/map/npc.cpp b/src/map/npc.cpp
index 88059b9..4d9a8d1 100644
--- a/src/map/npc.cpp
+++ b/src/map/npc.cpp
@@ -342,11 +342,10 @@ int npc_event_do_oninit(void)
*------------------------------------------
*/
static
-void npc_eventtimer(TimerData *, tick_t, BlockId id, NpcEvent data)
+void npc_eventtimer(TimerData *, tick_t, BlockId, NpcEvent data)
{
Option<P<struct event_data>> ev_ = ev_db.search(data);
dumb_ptr<npc_data_script> nd;
- dumb_ptr<block_list> bl = map_id2bl(id);
if (ev_.is_none() && data.label == stringish<ScriptLabel>("OnTouch"_s))
return;
@@ -372,21 +371,7 @@ void npc_eventtimer(TimerData *, tick_t, BlockId id, NpcEvent data)
return;
}
- if (nd->scr.event_needs_map)
- {
- int xs = nd->scr.xs;
- int ys = nd->scr.ys;
- if (nd->bl_m != bl->bl_m)
- return;
- if (xs > 0
- && (bl->bl_x < nd->bl_x - xs / 2 || nd->bl_x + xs / 2 < bl->bl_x))
- return;
- if (ys > 0
- && (bl->bl_y < nd->bl_y - ys / 2 || nd->bl_y + ys / 2 < bl->bl_y))
- return;
- }
-
- run_script(ScriptPointer(script_or_parent(nd), ev->pos), id, nd->bl_id);
+ run_script(ScriptPointer(script_or_parent(nd), ev->pos), BlockId(), nd->bl_id);
}
/*==========================================