void update_space( void )
{
std::list< SHIP_DATA *>::iterator iship;
log_string( "Running update_space" );
for( iship = list_ships_gnd.begin(); iship != list_ships_gnd.end(); )
{
SHIP_DATA *ship = *iship;
++iship;
if( ship->shipstate == SHIP_LAUNCH )
launchship(ship);
}
}
it = list.erase(it);
void update_space( void )
{
std::list< SHIP_DATA *>::iterator iship;
log_string( "Running update_space" );
for( iship = list_ships_gnd.begin(); iship != list_ships_gnd.end(); )
{
SHIP_DATA *ship = *iship;
++iship;
if( ship->shipstate == SHIP_LAUNCH )
launchship(ship);
}
}
for( bShip = list_ships_hyp.begin(); bShip != list_ships_hyp.end(); )
{
SHIP_DATA *ship2 = *bShip;
++bShip;
if( ship2->shipstate == SHIP_HYPERSPACE )
{
log_string( "Updating a hypership" );
ship2->hyperdistance -= ship2->hyperspeed * 2;
if( ship2->hyperdistance <= 0 )
{
ship_to_space( ship2 );
if( ship2->space == NULL )
{
echo_to_cockpit( AT_RED, ship2, "Ship lost in Hyperspace. Make new calculations." );
}
else
{
echo_to_room( AT_YELLOW, get_room_index( ship2->pilotseat ), "Hyperjump complete." );
echo_to_ship( AT_YELLOW, ship2, "The ship lurches slightly as it comes out of hyperspace." );
sprintf( buf, "%s enters the starsystem at %.0lf %.0lf %.0lf",
ship2->name, ship2->course->x, ship2->course->y, ship2->course->z );
echo_to_space( AT_YELLOW, ship2, buf, NULL );
ship2->shipstate = SHIP_READY;
if( ship2->space->name)
{
STRFREE(ship2->home );
ship2->home = STRALLOC(ship2->space->name );
}
if( str_cmp( "Public", ship2->owner ) )
save_ship( ship2 );
}
}
else
{
sprintf( buf, "&gRemaining Jump Distance: &w%d", ship2->hyperdistance );
echo_to_room( AT_WHITE, get_room_index( ship2->pilotseat ), buf );
}
}
}
}
[Health] 32700/32700 [Faith] 104/104 [Energy] 110/110]|> You can only do that in realspace!
Log: Updating space
Log: Updating a hypership
Remaining Jump Distance: 7368
Log: Updating a hypership
Remaining Jump Distance: 6858
Log: Updating a hypership
Remaining Jump Distance: 6348
Log: Updating a hypership
Remaining Jump Distance: 5838
[Health] 32700/32700 [Faith] 104/104 [Energy] 110/110]|>
Log: Updating space
Log: Updating a hypership
Remaining Jump Distance: 5328
Log: Updating a hypership
Remaining Jump Distance: 4818
Log: Updating a hypership
Remaining Jump Distance: 4308
Log: Updating a hypership
Remaining Jump Distance: 3798
gdb: