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://svn.code.sf.net/p/rathena/svn/trunk@12004 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
parent
8fdc689343
commit
c2dfc595b1
@ -4,6 +4,7 @@ AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO
|
|||||||
IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
|
IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
|
||||||
|
|
||||||
2008/01/03
|
2008/01/03
|
||||||
|
* Fixed npc unloading not clearing NPC touch cells (bugreport:595)
|
||||||
* Map cell mechanism rewrite
|
* Map cell mechanism rewrite
|
||||||
- defined a data structure for map cells (replaces 3 various cell arrays)
|
- defined a data structure for map cells (replaces 3 various cell arrays)
|
||||||
- both terrain (gat) and dynamic (cell) information is now stored as
|
- both terrain (gat) and dynamic (cell) information is now stored as
|
||||||
|
@ -1227,20 +1227,7 @@ int npc_remove_map(struct npc_data* nd)
|
|||||||
return 1; //Not assigned to a map.
|
return 1; //Not assigned to a map.
|
||||||
m = nd->bl.m;
|
m = nd->bl.m;
|
||||||
clif_clearunit_area(&nd->bl,2);
|
clif_clearunit_area(&nd->bl,2);
|
||||||
if (nd->subtype == WARP)
|
npc_unsetcells(nd);
|
||||||
{// 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);
|
|
||||||
|
|
||||||
}
|
|
||||||
map_delblock(&nd->bl);
|
map_delblock(&nd->bl);
|
||||||
//Remove npc from map[].npc list. [Skotlex]
|
//Remove npc from map[].npc list. [Skotlex]
|
||||||
ARR_FIND( 0, map[m].npc_num, i, map[m].npc[i] == nd );
|
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;
|
return;
|
||||||
|
|
||||||
//Locate max range on which we can locate npc cells
|
//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(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(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--);
|
for(y0 = y-ys; y0 > 0 && map_getcell(m, x, y0, CELL_CHKNPC); y0--);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user