From d3e6e368ac40c44fb13978a7529f8f818cdc0731 Mon Sep 17 00:00:00 2001 From: ultramage Date: Thu, 3 Jan 2008 22:00:59 +0000 Subject: Fixed npc unloading not clearing NPC touch cells (bugreport:595). Added a comment to npc_unsetcells(), pointing out that it's most likely not scanning for cells correctly. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12004 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/npc.c | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) (limited to 'src/map/npc.c') diff --git a/src/map/npc.c b/src/map/npc.c index 6514fbb6a..f18ba07a1 100644 --- a/src/map/npc.c +++ b/src/map/npc.c @@ -1227,20 +1227,7 @@ int npc_remove_map(struct npc_data* nd) return 1; //Not assigned to a map. m = nd->bl.m; clif_clearunit_area(&nd->bl,2); - if (nd->subtype == WARP) - {// Remove corresponding NPC CELLs - int j, xs, ys, x, y; - x = nd->bl.x; - y = nd->bl.y; - xs = nd->u.warp.xs; - ys = nd->u.warp.ys; - - for( i = y-ys; i < y+ys; i++ ) - for( j = x-xs; j < x+xs; j++ ) - if( map_getcell(m, j, i, CELL_CHKNPC) ) - map_setcell(m, j, i, CELL_CLRNPC); - - } + npc_unsetcells(nd); map_delblock(&nd->bl); //Remove npc from map[].npc list. [Skotlex] ARR_FIND( 0, map[m].npc_num, i, map[m].npc[i] == nd ); @@ -2014,6 +2001,7 @@ void npc_unsetcells(struct npc_data* nd) return; //Locate max range on which we can locate npc cells + //FIXME: does this really do what it's supposed to do? [ultramage] for(x0 = x-xs; x0 > 0 && map_getcell(m, x0, y, CELL_CHKNPC); x0--); for(x1 = x+xs; x1 < map[m].xs-1 && map_getcell(m, x1, y, CELL_CHKNPC); x1++); for(y0 = y-ys; y0 > 0 && map_getcell(m, x, y0, CELL_CHKNPC); y0--); -- cgit v1.2.3-60-g2f50