Posted by
| Robert Powell
Australia (367 posts) Bio
|
Message
| well i got real close to making it work via command line, i could load the core file just didnt know how to match that with the exe file, but thanks now i do.
Oh the codebase is smaugfuss1.4a, its probably important to know this.
Here is the backtrace information that the core file gave me, im trying to install a locker snippet that i got from http://www.shadow-lands.com/snippets.html, it makes the lockers ok opens ok but crashes on closing the locker.
#0 0x400c21c6 in mallopt () from /lib/i686/libc.so.6
(gdb) bt
#0 0x400c21c6 in mallopt () from /lib/i686/libc.so.6
#1 0x400c0e6f in free () from /lib/i686/libc.so.6
#2 0x080595dc in clear_vrooms () at act_move.c:355
#3 0x080c4295 in delete_locker (ch=0x8514118) at locker.c:381
#4 0x080c4023 in do_locker (ch=0x8514118, argument=0xbffff207 "close")
at locker.c:298
#5 0x080c2dbf in interpret (ch=0x8514118, argument=0xbffff207 "close")
at interp.c:547
#6 0x0809861d in game_loop () at comm.c:638
#7 0x08097ef1 in main (argc=2, argv=0xbffff714) at comm.c:289
#8 0x40064c57 in __libc_start_main () from /lib/i686/libc.so.6
Here is the the section of code from locker.c that the dump points to. the while is line 381
void delete_locker( CHAR_DATA *ch )
{
/* Clean-up the locker room -- Remove the loaded objects */
while ( ch->pcdata->locker_room->first_content )
{
extract_obj( ch->pcdata->locker_room->first_content );
}
/* Kill the locker object */
DISPOSE( ch->pcdata->locker );
ch->pcdata->locker = NULL;
ch->pcdata->locker_vnum = 0;
ch->pcdata->locker_room = NULL;
/* Need to delete the virtual room */
clear_vrooms();
}
The 298 is the sprintf exeeded weight limit, tho in another dump it has refered to the line for saving the locker.
else if( ! str_cmp( arg, "close" ) )
{
if( ! ch->pcdata->locker )
{
send_to_char( "You are not currently in the locker room.\r\n", ch );
return;
}
locker = ch->pcdata->locker;
/* Total the weight of the contents */
locker->holding = 0;
for( obj = ch->in_room->first_content; obj; obj = obj->next_content )
{
locker->holding = locker->holding + ( obj->weight * obj->count );
if( obj->item_type == ITEM_CONTAINER )
{
send_to_char( "You may not leave containers in the locker room.\r\n", ch );
return;
}
}
if( locker->holding > locker->capacity )
{
sprintf( buf, "The weight limit of your locker has beed exceeded. "
"You must carry\r\nsome items out when you leave.\r\n" );
send_to_char( buf, ch );
return;
}
/* Save the locker */
fwrite_locker( ch );
/* Return the player to the real world. */
char_from_room( ch );
char_to_room( ch, get_room_index( ch->pcdata->locker_vnum ) );
delete_locker( ch );
do_look( ch, "auto" );
send_to_char( "Your locker has been closed and saved.\r\n", ch );
}
else
{
send_to_char( "Syntax: locker <open | close>\r\n", ch );
}
return;
}
The other bits of code that i thin are important would be the stuff i put into save.c
/*
* Slick recursion to write lists backwards,
* so loading them will load in forwards order.
*/
> if ( obj->prev_content && ( os_type != OS_CORPSE && os_type != OS_LOCKER ) )
fwrite_obj( ch, obj->prev_content, fp, iNest, OS_CARRY );
and
fprintf( fp, "ShortDescr %s~\n", obj->short_descr );
if ( QUICKMATCH( obj->description, obj->pIndexData->description ) == 0 )
fprintf( fp, "Description %s~\n", obj->description );
if ( QUICKMATCH( obj->action_desc, obj->pIndexData->action_desc ) == 0 )
fprintf( fp, "ActionDesc %s~\n", obj->action_desc );
fprintf( fp, "Vnum %d\n", obj->pIndexData->vnum );
> if ( ( os_type == OS_CORPSE || os_type == OS_LOCKER ) && obj->in_room )
fprintf( fp, "Room %d\n", obj->in_room->vnum );
if ( obj->extra_flags != obj->pIndexData->extra_flags )
fprintf( fp, "ExtraFlags %d\n", obj->extra_flags );
if ( obj->wear_flags != obj->pIndexData->wear_flags )
fprintf( fp, "WearFlags %d\n", obj->wear_flags );
I think im totaly lost hehe. IN the mean time i have found another locker snippet in lrdelders site i think i will try it while i wait for a responce on thin one. |
Just a guy having a bit of fun. Nothing more, nothing less, I do not need I WIN to feel validated. | Top |
|