Issue Information
-
#000434
-
2 - Fair
-
Confirmed
Issue Confirmations
-
Yes (0)No (0)
Originally posted by theultramage
http://www.eathena.w...ker&showbug=434
When a npc moves, it removes its trigger area. This requires all nearby npcs whose area overlapped the removed one to re-deploy their cells.
Problem is, the way used now for searching does not discover all these npcs, and so once the npc moves, it cuts off some npcs' area.
The search keeps extending in a direction until it finds a cell that's not a NPC cell.
Current scan pattern:
░░░░▓░░░░
░░░░▓░░░░
░░▒▒▓▒▒░░
▓▓▓▒▒▒▓▓▓
░░▒▒▓▒▒░░
░░░░▓░░░░
░░░░▓░░░░
Proposed scan pattern:
This post has been edited by theultramage: Nov 17 2007, 11:35 PM
http://www.eathena.w...ker&showbug=434
CODE
//Locate max range on which we can locate npc cells
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--);
for(y1 = y+ys; y1 < map[m].ys-1 && map_getcell(m, x, y1, CELL_CHKNPC); y1++);
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--);
for(y1 = y+ys; y1 < map[m].ys-1 && map_getcell(m, x, y1, CELL_CHKNPC); y1++);
When a npc moves, it removes its trigger area. This requires all nearby npcs whose area overlapped the removed one to re-deploy their cells.
Problem is, the way used now for searching does not discover all these npcs, and so once the npc moves, it cuts off some npcs' area.
The search keeps extending in a direction until it finds a cell that's not a NPC cell.
Current scan pattern:
░░░░▓░░░░
░░░░▓░░░░
░░▒▒▓▒▒░░
▓▓▓▒▒▒▓▓▓
░░▒▒▓▒▒░░
░░░░▓░░░░
░░░░▓░░░░
Proposed scan pattern:
CODE
222222222
211111112
210000012
210000012
210000012
211111112
222222222
(concentric rectangles expanding in iterations, stops when entire 'level' has no NPC cells)211111112
210000012
210000012
210000012
211111112
222222222
This post has been edited by theultramage: Nov 17 2007, 11:35 PM
changed severity to: 2 - Fair