From cfeb9d925d583f3767f512ee554004513abbb69c Mon Sep 17 00:00:00 2001 From: Tezer Date: Fri, 23 Mar 2018 21:35:54 -0400 Subject: fix a bug introduced by wushin, which freeyorp highlighted with his previous patch --- src/map/npc.cpp | 19 ++----------------- 1 file 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> ev_ = ev_db.search(data); dumb_ptr nd; - dumb_ptr bl = map_id2bl(id); if (ev_.is_none() && data.label == stringish("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); } /*========================================== -- cgit v1.2.3-60-g2f50