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

  • #008517

  • 0 - None Assigned

  • New

Issue Confirmations

  • Yes (2)No (0)
Photo

Monsters can't walk on invisible NPCs

Posted by Valo on 01 February 2015 - 07:23 PM

This breaks several scripts, including monster race.

I fixed it like this:
if(map->count_oncell(md->bl.m, md->bl.x, md->bl.y, BL_CHAR, 1) > battle_config.official_cell_stack_limit ||
                map->count_oncell(md->bl.m, md->bl.x, md->bl.y, BL_NPC, 3) > battle_config.official_cell_stack_limit) {
                unit->walktoxy(&md->bl, md->bl.x, md->bl.y, 8);
        }

and

if ((flag&8) && !map->closest_freecell(bl->m, &x, &y, BL_CHAR, 1)) //This might change x and y

But someone might find a better solution.

Better would be to just leave map.c untouched. As Herc already has implemented the flag to not count invisible units, the only thing missing is to change the function call to:
    if ((flag&8) && !map->closest_freecell(bl->m, &x, &y, BL_CHAR|BL_NPC, 3)) //This might change x and y
		return 0;
It shouldn't count invisible BL_CHARs in the first place, or should it?