From bd28a6d4b623ee8cc80d39fe1e7bfcf32c8c81ee Mon Sep 17 00:00:00 2001 From: skotlex Date: Wed, 29 Mar 2006 16:59:08 +0000 Subject: - Applied a fix to not do xs/ys checks on npc_doevent when the npc is not on a map. - You can't return to egg a pet that has run away now. - Added ers support to the delayed mob drops. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5800 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/npc.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'src/map/npc.c') diff --git a/src/map/npc.c b/src/map/npc.c index 4f0877076..b890a4ce6 100644 --- a/src/map/npc.c +++ b/src/map/npc.c @@ -821,13 +821,16 @@ int npc_event (struct map_session_data *sd, const unsigned char *eventname, int xs=nd->u.scr.xs; ys=nd->u.scr.ys; - if (xs>=0 && ys>=0 && (strcmp(((eventname)+strlen(eventname)-6),"Global") != 0) ) { - if (nd->bl.m >= 0 && nd->bl.m != sd->bl.m ) - return 1; - if ( xs>0 && (sd->bl.xbl.x-xs/2 || nd->bl.x+xs/2bl.x) ) - return 1; - if ( ys>0 && (sd->bl.ybl.y-ys/2 || nd->bl.y+ys/2bl.y) ) - return 1; + if (xs>=0 && ys>=0 && (strcmp(((eventname)+strlen(eventname)-6),"Global") != 0) ) + { + if (nd->bl.m >= 0) { //Non-invisible npc + if (nd->bl.m != sd->bl.m ) + return 1; + if ( xs>0 && (sd->bl.xbl.x-xs/2 || nd->bl.x+xs/2bl.x) ) + return 1; + if ( ys>0 && (sd->bl.ybl.y-ys/2 || nd->bl.y+ys/2bl.y) ) + return 1; + } } if ( sd->npc_id!=0) { -- cgit v1.2.3-70-g09d2