From 0f94f735f50a320d97c0dacb806de2a65662cc3c Mon Sep 17 00:00:00 2001 From: skotlex Date: Sun, 11 Nov 2007 10:12:58 +0000 Subject: - Cleaned up pc_calc_weapontype - made on-touch areas work with walking npcs. Note that the implementation is performance may not be optimal, but I am not sure if it can be done in any better way. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11713 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/npc.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/map/npc.c') diff --git a/src/map/npc.c b/src/map/npc.c index f6e7f0cf0..4752991c7 100644 --- a/src/map/npc.c +++ b/src/map/npc.c @@ -1977,7 +1977,7 @@ void npc_unsetcells(struct npc_data* nd) if (m < 0 || xs < 1 || ys < 1) return; - //Locate max range on which we can localte npce cells + //Locate max range on which we can locate npc cells for(x0 = x-xs/2; x0 > 0 && map_getcell(m, x0, y, CELL_CHKNPC); x0--); for(x1 = x+xs/2-1; x1 < map[m].xs && map_getcell(m, x1, y, CELL_CHKNPC); x1++); for(y0 = y-ys/2; y0 > 0 && map_getcell(m, x, y0, CELL_CHKNPC); y0--); @@ -1999,11 +1999,9 @@ void npc_movenpc(struct npc_data* nd, int x, int y) x = cap_value(x, 0, map[m].xs-1); y = cap_value(y, 0, map[m].ys-1); - npc_unsetcells(nd); map_foreachinrange(clif_outsight, &nd->bl, AREA_SIZE, BL_PC, &nd->bl); map_moveblock(&nd->bl, x, y, gettick()); map_foreachinrange(clif_insight, &nd->bl, AREA_SIZE, BL_PC, &nd->bl); - npc_setcells(nd); } int npc_changename(const char* name, const char* newname, short look) -- cgit v1.2.3-70-g09d2