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

  • #000419

  • 2 - Fair

  • Fixed

Issue Confirmations

  • Yes (0)No (0)
Photo

Loading Of Badly Placed Npcs

Posted by Hercules Bot on 16 November 2007 - 12:44 PM

Originally posted by theultramage
http://www.eathena.w...ker&showbug=419

(originally reported in this topic)

I found a case of an incorrectly placed npc: its coordinates were outside of the map's dimensions.
Problem is that the code doesn't handle this situation very well...

CODE
nd->n = map_addnpc(m, nd);
status_change_init(&nd->bl);
unit_dataset(&nd->bl);
nd->ud.dir = dir;
npc_setcells(nd);
map_addblock(&nd->bl); <- this fails

So first it creates the npc, adds it to various databases, adds it to the map's npc list, deploys its trigger area,
and afterwards tries to attach the npc to a specific map square (returning '1'). No warnings whatsoever.
I suggest at least adding an 'if' here to report "invalid map or map coordinates".

The point of concern is that when doing @reloadscript, npc_remove_map() does "if(nd->bl.prev == NULL) return 1;", and doesn't remove the npc from the list. We then get npcs that don't get removed, and a followup warning message in the mapserver console.

This post has been edited by theultramage: Nov 20 2007, 11:15 AM