void StarSystem::ProcessPendingJumps()
{
    for (unsigned int kk = 0; kk < pendingjump.size(); ++kk) {
        Unit *un = pendingjump[kk]->un.GetUnit();
        if (pendingjump[kk]->delay >= 0) {
            Unit *jp = pendingjump[kk]->jumppoint.GetUnit();
            if (un && jp) {
                QVector delta = ( jp->LocalPosition()-un->LocalPosition() );
                float   dist  = delta.Magnitude();
                if (pendingjump[kk]->delay > 0) {
                    float speed  = dist/pendingjump[kk]->delay;
                    bool  player = (_Universe->isPlayerStarship( un ) != NULL);
                    if (dist > 10 && player) {
                        if (un->activeStarSystem == pendingjump[kk]->orig)
                            un->SetCurPosition( un->LocalPosition()+SIMULATION_ATOM*delta*(speed/dist) );
                    } else if (!player) {
                        un->SetVelocity( Vector( 0, 0, 0 ) );
                    }
                    static bool setshieldzero =
                        XMLSupport::parse_bool( vs_config->getVariable( "physics", "jump_disables_shields", "true" ) );
                    if (setshieldzero)
                        SetShieldZero( un );
                }
            }
            double time = GetElapsedTime();
            if (time > 1)
                time = 1;
            pendingjump[kk]->delay -= time;
            continue;
        } else {
#ifdef JUMP_DEBUG
            VSFileSystem::vs_fprintf( stderr, "Volitalizing pending jump animation.\n" );
#endif
            _Universe->activeStarSystem()->VolitalizeJumpAnimation( pendingjump[kk]->animation );
        }
        int playernum = _Universe->whichPlayerStarship( un );
        //In non-networking mode or in networking mode or a netplayer wants to jump and is ready or a non-player jump
        if ( Network == NULL || playernum < 0 || ( Network != NULL && playernum >= 0 && Network[playernum].readyToJump() ) ) {
            Unit *un = pendingjump[kk]->un.GetUnit();
            StarSystem *savedStarSystem = _Universe->activeStarSystem();
            //Download client descriptions of the new zone (has to be blocking)
            if (Network != NULL)
                Network[playernum].downloadZoneInfo();
            if ( un == NULL || !_Universe->StillExists( pendingjump[kk]->dest )
                || !_Universe->StillExists( pendingjump[kk]->orig ) ) {
#ifdef JUMP_DEBUG
                VSFileSystem::vs_fprintf( stderr, "Adez Mon! Unit destroyed during jump!\n" );
#endif
                delete pendingjump[kk];
                pendingjump.erase( pendingjump.begin()+kk );
                --kk;
                continue;
            }
            bool dosightandsound = ( (pendingjump[kk]->dest == savedStarSystem) || _Universe->isPlayerStarship( un ) );
            _Universe->setActiveStarSystem( pendingjump[kk]->orig );
            if ( un->TransferUnitToSystem( kk, savedStarSystem, dosightandsound ) )
                un->DecreaseWarpEnergy( false, 1.0f );
            if (dosightandsound)
                _Universe->activeStarSystem()->DoJumpingComeSightAndSound( un );
	    _Universe->AccessCockpit()->OnJumpEnd(un);
            delete pendingjump[kk];
            pendingjump.erase( pendingjump.begin()+kk );
            --kk;
            _Universe->setActiveStarSystem( savedStarSystem );
            //In networking mode we tell the server we want to go back in game
            if (Network != NULL) {
                //Find the corresponding networked player
                if (playernum >= 0) {
                    Network[playernum].inGame();
                    Network[playernum].unreadyToJump();
                }
            }
        }
    }
}