This code:
Once in a while, a pacifist mob will slip by somehow. It shouldn't, but it is. Any ideas what's wrong?
Debugging, I found this. The right mob index was selected, but in the get_char_world it selected the wrong mob due to similar mob name. "Panther Villager" was the mob index but it selected "Panther villager 2". Any ideas what I should do, to have it select the right one? Obviously getting by the mob name isn't gonna work.
for (mcounter = 0; mcounter < 99999; mcounter ++)
{
mob_vnum = number_range(99, 6000);
if ( (vsearch = get_mob_index(mob_vnum) ) != NULL )
{
level_diff = vsearch->level - ch->level;
/* Level differences to search for. Moongate has 350
levels, so you will want to tweak these greater or
less than statements for yourself. - Vassago */
if ( level_diff < 15
&& vsearch->pShop == NULL
&& vsearch->rShop == NULL
&& !xIS_SET(vsearch->act,ACT_PACIFIST)
&& !xIS_SET(vsearch->act,ACT_NOTARGET)
&& !xIS_SET(vsearch->act,ACT_PET)
&& !xIS_SET(vsearch->act,ACT_TRAIN)
&& !xIS_SET(vsearch->act,ACT_PRACTICE)
&& !xIS_SET(vsearch->act,ACT_PROTOTYPE)
&& !xIS_SET(vsearch->act,ACT_IMMORTAL)) break;
else vsearch = NULL;
}
}
if ( vsearch == NULL || ( victim = get_char_world( ch, vsearch->player_name ) ) == NULL || !IS_NPC(victim))
...Once in a while, a pacifist mob will slip by somehow. It shouldn't, but it is. Any ideas what's wrong?
Debugging, I found this. The right mob index was selected, but in the get_char_world it selected the wrong mob due to similar mob name. "Panther Villager" was the mob index but it selected "Panther villager 2". Any ideas what I should do, to have it select the right one? Obviously getting by the mob name isn't gonna work.