Wow - there's a blast from the past. I can see in the comments on the old "circle with goodies" download that I was editing that at some time in the past.
The real_guild() function in gengld.c currently looks like this:
Code:
guild_rnum real_guild(guild_vnum vnum)
{
guild_rnum bot, top, mid, last_top;
if (top_guild < 0)
return NOWHERE;
bot = 0;
top = top_guild;
/* perform binary search on guild_table */
for (;;) {
last_top = top;
mid = (bot + top) / 2;
if (GM_NUM(mid) == vnum)
return (mid);
if (bot >= top)
return (NOWHERE);
if (GM_NUM(mid) > vnum)
top = mid - 1;
else
bot = mid + 1;
if (top > last_top)
return NOWHERE;
}
}
I suggest adding this somewhere above the loop to see what the actual values are:
Code:
log("real_guild() called with argument=%ld, top_guild=%ld", vnum, top_guild);
(you may need to use %d instead of %ld - try both)