Alright, well, a while back before my game opened I changed the vnums. I guess I just assumed I did it right and it saved correctly and everything, so beyond that I never tested it. Recently, people kept getting sent to limbo because of higher vnums that weren't expected in the code. Anyways, that prompted me to fix everything that related to vnums in handler.c. Anyways, things still seemed to be affected. Things such as list (seems to be low level mortals) and the skill beg. I've checked them, replaced them and everything and nothing has fixed them. I'm assuming its related to vnums or some call that I forgot. Anyways, list is very critical, and people use some commands to crash the mud so area's will reset. Anyways, I would like to fix these problems.
Anyways, I've checked and replaced list and everything seems alright (I don't use pet shops). It doesn't appear to call anything besides find_keeper. Anyways, I suppose I'll post the current code here (only modification is that I took out displaying the object size).
List:
void do_list( CHAR_DATA *ch, char *argument )
{
if ( IS_SET(ch->in_room->room_flags, ROOM_PET_SHOP) )
{
ROOM_INDEX_DATA *pRoomIndexNext;
CHAR_DATA *pet;
bool found;
pRoomIndexNext = get_room_index( ch->in_room->vnum + 1 );
if ( !pRoomIndexNext )
{
bug( "Do_list: bad pet shop at vnum %d.", ch->in_room->vnum );
send_to_char( "You can't do that here.\n\r", ch );
return;
}
found = FALSE;
for ( pet = pRoomIndexNext->first_person; pet; pet = pet->next_in_room )
{
if ( IS_SET(pet->act, ACT_PET) && IS_NPC(pet) )
{
if ( !found )
{
found = TRUE;
send_to_char( "Pets for sale:\n\r", ch );
}
ch_printf( ch, "[%2d] %8d - %s\n\r",
pet->top_level,
10 * pet->top_level * pet->top_level,
pet->short_descr );
}
}
if ( !found )
send_to_char( "Sorry, we're out of pets right now.\n\r", ch );
return;
}
else
{
char arg[MAX_INPUT_LENGTH];
CHAR_DATA *keeper;
OBJ_DATA *obj;
int cost;
int oref = 0;
bool found;
one_argument( argument, arg );
if ( ( keeper = find_keeper( ch ) ) == NULL )
return;
found = FALSE;
for ( obj = keeper->last_carrying; obj; obj = obj->prev_content )
{
if ( obj->wear_loc == WEAR_NONE
&& can_see_obj( ch, obj ) )
{
oref++;
if ( ( cost = get_cost( ch, keeper, obj, TRUE ) ) > 0
&& ( arg[0] == '\0' || nifty_is_name( arg, obj->name ) ) )
{
if ( !found )
{
found = TRUE;
send_to_char( "[Price] {ref} Item\n\r", ch );
}
ch_printf( ch, "[%5d] {%3d} %s.\n\r", cost, oref, capitalize( obj->short_descr ) );
}
}
}
if ( !found )
{
if ( arg[0] == '\0' )
send_to_char( "You can't buy anything here.\n\r", ch );
else
send_to_char( "You can't buy that here.\n\r", ch );
}
return;
}
}
Find_keeper:
CHAR_DATA *find_keeper( CHAR_DATA *ch )
{
CHAR_DATA *keeper;
SHOP_DATA *pShop;
pShop = NULL;
for ( keeper = ch->in_room->first_person;
keeper;
keeper = keeper->next_in_room )
if ( IS_NPC(keeper) && (pShop = keeper->pIndexData->pShop) != NULL )
break;
if ( !pShop )
{
send_to_char( "You can't do that here.\n\r", ch );
return NULL;
}
/*
* Shop hours.
*/
if ( time_info.hour < pShop->open_hour )
{
do_say( keeper, "Sorry, come back later." );
return NULL;
}
if ( time_info.hour > pShop->close_hour )
{
do_say( keeper, "Sorry, come back tomorrow." );
return NULL;
}
if ( !knows_language( keeper, ch->speaking, ch ) )
{
do_say( keeper, "I can't understand you." );
return NULL;
}
return keeper;
}
Anyways, this might have something to do with something I didn't fix after changing the vnums. Hopefully I didn't fataly mess something up.
Thanks for any and all help resolving these problems. |