SWR crash

Posted by Destiny on Thu 16 Jan 2003 02:30 PM — 3 posts, 14,172 views.

#0
in space.c under do_launch

{
int chance;
long price = 0;
SHIP_DATA *ship;
char buf[MAX_STRING_LENGTH];
SHIP_DATA *onship;

if ( ( onship = ship_from_hanger( ship->lastdoc ) )
!= NULL && ! onship->bayopen )
{
send_to_char("&RThe hanger is closed!\n\r",ch);
return;
}

this check alone is crashing the mud and for the life of me i cannot figure out why. anyone else have any ideas? it crashes every time someone tries to launch (regardless of whether or not their ship is in a hangar)
Australia Forum Administrator #1
I can't see where "ship" is initialised. You can't dereference a pointer (eg. ship->lastdoc) unless the pointer points to something valid.
USA #2
I believe this was a double post from the 'SMAUG Coding' forums.