SWR crashes (open/closebay)

Posted by Destiny on Thu 16 Jan 2003 02:52 PM — 8 posts, 26,213 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)
USA #1
It's highly unlikely the cause of your crash is that code you have posted. It *IS* possible that the ship_from_hanger function could be crashing it though. Post it so we can take a look at it. Btw, If you say it's crashing no matter where someone launches from, do a test and comment out that section of code, then see what happens.
#2
I've already commented out that check, but it looks like any time i use onship it crashes.
#3
let me clarify that. i tried commenting that out once and launch works fine, then i try a few other ways of doing it that should work as well. regardless of how i use onship, it crashes the mud.
USA #4
It's more then likely the ship_from_hangar code then. Post it ;-)
USA #5
Just thought of something.. where exactly is that code you posted, located in do_launch? If it's not below:

if ( (ship = ship_from_cockpit(ch->in_room->vnum)) == NULL )
{
send_to_char("&RYou must be in the cockpit of a ship to do that!\n\r",ch);
return;
}

Then THAT would be why it's crashing ;-)
#6
nevermind, i figured it out. I was doing onship = ship->blah blah, but i hadnt set ship to anything yet.
USA #7
Hehe. Kinda what I was thinking ;-)