From 2f90b3a569c9627f0fa56ed282a33b596f0026f3 Mon Sep 17 00:00:00 2001 From: Ben Longbons Date: Sun, 9 Nov 2014 19:56:50 -0800 Subject: Add explicit check for mapless events --- src/map/npc.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/map/npc.cpp') diff --git a/src/map/npc.cpp b/src/map/npc.cpp index 304224a..90ac917 100644 --- a/src/map/npc.cpp +++ b/src/map/npc.cpp @@ -465,7 +465,6 @@ int npc_event(dumb_ptr sd, NpcEvent eventname, { Option> ev_ = ev_db.search(eventname); dumb_ptr nd; - int xs, ys; if (sd == nullptr) { @@ -490,10 +489,10 @@ int npc_event(dumb_ptr sd, NpcEvent eventname, return 0; } - xs = nd->scr.xs; - ys = nd->scr.ys; - if (xs >= 0 && ys >= 0) + if (nd->scr.event_needs_map) { + int xs = nd->scr.xs; + int ys = nd->scr.ys; if (nd->bl_m != sd->bl_m) return 1; if (xs > 0 -- cgit v1.2.3-60-g2f50