Issue information

Issue ID
#3646
Status
Fixed
Severity
None
Started
Hercules Elf Bot
Oct 13, 2009 5:43
Last Post
Hercules Elf Bot
Apr 4, 2012 8:52
Confirmation
N/A

Hercules Elf Bot - Oct 13, 2009 5:43

Originally posted by [b]Orcao[/b]
http://www.eathena.ws/board/index.php?autocom=bugtracker&showbug=3646

In mob.c -> mob_spawn_guardian():
CODE
    if((x<=0 || y<=0) && !map_search_freecell(NULL, m, &x, &y, -1,-1, 0))
    {
        ShowWarning("mob_spawn_guardian: Couldn't locate a spawn cell for guardian class %d (index %d) at castle map %s\n",class_, guardian, map[m].name);
        return 0;
    }
If an x or y value that is less than or equal to 0 is passed to that, the map will spout a debug error and map_search_freecell will return 0 without finding a cell.

The reason:
CODE
    if( !src && (!(flag&1) || flag&2) )
    {
        ShowDebug("map_search_freecell: Incorrect usage! When src is NULL, flag has to be &1 and can't have &2\n");
        return 0;
    }

    if (flag&1) {
        bx = *x;
        by = *y;
    } else {
        bx = src->x;
        by = src->y;
        m = src->m;
    }


The fix (back in mob_spawn_guardian):
CODE
    if((x<=0 || y<=0) && !map_search_freecell(NULL, m, &x, &y, -1,-1, 1))
    {
        ShowWarning("mob_spawn_guardian: Couldn't locate a spawn cell for guardian class %d (index %d) at castle map %s\n",class_, guardian, map[m].name);
        return 0;
    }

Specifically, just changing the flag on the map_search_freecell to 1.

Hercules Elf Bot - Dec 9, 2011 4:37

Originally posted by [b]Ind[/b]
it has been fixed in a previous eA revision