Mud crash with roomflag nofloor
< Newer Topic
:: Older Topic >
Pages:<< prev 1 next >>
#1 Oct 13, 2020 8:23 am
Fledgling
GroupMembers
Posts11
JoinedMay 26, 2011
Hi.
I'm using codebase Swfote 2.1.
when I use the nofloor flag in a room and i'm falling down, the mud crashess.
The error is:
That line of handler.c is:
And the nofloor flag code in the act_move.c file is:
Thank you in advance and sorry for my English
I'm using codebase Swfote 2.1.
when I use the nofloor flag in a room and i'm falling down, the mud crashess.
The error is:
#0 0x00000000004ddd52 in char_to_room (ch=0x12e7490, pRoomIndex=0x0) at handler.c:1098
That line of handler.c is:
void char_to_room( CHAR_DATA *ch, ROOM_INDEX_DATA *pRoomIndex ) { OBJ_DATA *obj; if ( !ch ) { bug( "Char_to_room: NULL ch!", 0 ); return; } if( !get_room_index( pRoomIndex->vnum ) ) pRoomIndex = NULL;
And the nofloor flag code in the act_move.c file is:
bool will_fall( CHAR_DATA *ch, int fall ) { if ( IS_SET( ch->in_room->room_flags, ROOM_NOFLOOR ) && CAN_GO(ch, DIR_DOWN) && (!IS_AFFECTED( ch, AFF_FLYING ) || ( ch->mount && !IS_AFFECTED( ch->mount, AFF_FLYING ) ) ) ) { if ( fall > 80 ) { bug( "Falling (in a loop?) more than 80 rooms: vnum %d", ch->in_room->vnum ); char_from_room( ch ); char_to_room( ch, get_room_index( wherehome(ch) ) ); fall = 0; return TRUE; } set_char_color( AT_FALLING, ch ); send_to_char( "Caes...\n\r", ch ); move_char( ch, get_exit(ch->in_room, DIR_DOWN), ++fall ); return TRUE; } return FALSE; }
Thank you in advance and sorry for my English
#2 Oct 13, 2020 12:37 pm
Off the Edge of the Map
GroupAdministrators
Posts1,200
JoinedMar 21, 2006
Gunner said:
#0 0x00000000004ddd52 in char_to_room (ch=0x12e7490, pRoomIndex=0x0) at handler.c:1098
pRoomIndex = 0x0 means that RoomIndex was NULL, or non-existant.
#3 Oct 13, 2020 3:32 pm
Fledgling
GroupMembers
Posts11
JoinedMay 26, 2011
it's strange, because the room does exist. in fact if there is no exit down does not run the nofloor
#4 Oct 16, 2020 5:21 pm
Geomancer
GroupAdministrators
Posts1,946
JoinedJul 26, 2005
void char_to_room( CHAR_DATA *ch, ROOM_INDEX_DATA *pRoomIndex ) { OBJ_DATA *obj; if ( !ch ) { bug( "Char_to_room: NULL ch!", 0 ); return; } if( !get_room_index( pRoomIndex->vnum ) ) pRoomIndex = NULL;
id suggest maybe changing that last if check to
if( !pRoomIndex || !get_room_index( pRoomIndex->vnum ) )
Can even try to handle it and give some log info to protect it from crashing there if you want. In mine it looks like it will warn about trying to put them in a null room. place them in the previous room if there is one, try to put them in limbo if no previous room, tell you to prepare for a crash if none of those exist lol.
#5 Oct 21, 2020 3:16 am
Conjurer
GroupMembers
Posts423
JoinedMar 7, 2005
My understanding from seeing this same question on Nick's forum was that the issue happened in a variety of places and circumstances, so it would seem a larger problem than just falling.
You need to find out why char_to_room( ) is being called with a NULL value of the pRoomIndex argument.
Is this only happening with falling or elsewhere? If so, where else does it happen? Under what conditions?
You need to find out why char_to_room( ) is being called with a NULL value of the pRoomIndex argument.
Is this only happening with falling or elsewhere? If so, where else does it happen? Under what conditions?
#6 Oct 21, 2020 12:53 pm
Black Hand
GroupAdministrators
Posts3,697
JoinedJan 1, 2002
What really needs to be done here is an analysis of the backtrace. I'd suggest having a look through the GDB Tutorial that's linked in the main menu at the top right and then figuring out why NULL data is being passed.
Making the change Remcon suggested will simply mask the issue and it'll never be found, and will likely go on to cause crashes elsewhere that become even harder to diagnose.
Making the change Remcon suggested will simply mask the issue and it'll never be found, and will likely go on to cause crashes elsewhere that become even harder to diagnose.
#7 Oct 21, 2020 5:58 pm
Geomancer
GroupAdministrators
Posts1,946
JoinedJul 26, 2005
lol it logs it and lets you pin point when its happening. had the issue once and using that allowed me to stop crazy crashing while i dig into what was crashing it and when null was being passed.
#8 Nov 4, 2020 1:48 pm
Last edited Nov 4, 2020 1:49 pm by GatewaySysop
Conjurer
GroupMembers
Posts423
JoinedMar 7, 2005
Based on the complete lack of follow-up or any recent reply after myself and others attempted to help this same OP on Nick's forum, I am not at all surprised that there's been no response from the OP here either. At least we tried (again).
Pages:<< prev 1 next >>