The 'get_random_char' function present in the OLC version of QuickMUD
(OLC 1.81, I believe? here's part of the header from mob_prog.c)
contains a buggy get_random_char.
* MOBprograms for ROM 2.4 v0.98g (C) M.Nylander 1996 *
Replace:
for( ; vch; vch = vch->next_in_room )
{
if ( mob
&& mob != vch
&& !IS_NPC( vch )
&& can_see( mob, vch )
&& ( now = number_percent() ) > highest )
{
victim = vch;
highest = now;
}
}
else if ( (now = number_percent()) > highest )
{
victim = vch;
highest = now;
}
}
With:
for( ; vch; vch = vch->next_in_room )
{
if ( mob )
{
if ( mob != vch
&& !IS_NPC( vch )
&& can_see( mob, vch )
&& ( now = number_percent() ) > highest )
{
victim = vch;
highest = now;
}
}
else if ( (now = number_percent()) > highest )
{
victim = vch;
highest = now;
}
}
Otherwise the code will select NPCs.
There were several other bugs found in the mobprog code, can't remember
them offhand, though.