Jump to content

  •  

Bug Tracker Migration

June 3rd
Good news everyone! The staff has decided that it is time to slowly kill off this Bug Tracker. We will begin the process of slowly migrating from this Bug Tracker over to our Github Issues which can be found here: https://github.com/HerculesWS/Hercules/issues

Over the next couple of days, I will be closing off any opportunity to create new reports. However, I still will keep the opportunity to reply to existing Bug Reports. Doing this will allow us to slowly fix any bug reports we have listed here so that we can easily migrate over to our Issue Tracker.

Update - June 7th 2015: Creating new bug posts has been disabled. Please use our https://github.com/HerculesWS/Hercules/issues tracker to post bugs. Users are still able to reply to existing bug posts.

- Administration

Issue Information

Issue Confirmations

  • Yes (0)No (0)
Photo

Npc Cell Setting Problem

Posted by Hercules Bot on 18 November 2007 - 07:31 AM

Originally posted by theultramage
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++);


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)

This post has been edited by theultramage: Nov 17 2007, 11:35 PM

Ind 
changed severity to: 2 - Fair