[Change] Remove hard forcing of player speed and instead use incremental slowdown.

[Fix] Pause would give instant travel. Not now!!
This commit is contained in:
Allanis 2013-02-20 20:20:48 +00:00
parent b2a887ba45
commit 7e3bca1e51
3 changed files with 8 additions and 5 deletions

View File

@ -39,8 +39,9 @@ static void pilots_pause(void) {
int i, j;
unsigned int t = SDL_GetTicks();
for(i = 0; i < pilots; i++) {
pilot_stack[i]->tcontrol -= t;
pilot_stack[i]->ptimer -= t;
pilot_stack[i]->tcontrol -= t;
for(j = 0; j < MAX_AI_TIMERS; j++)
pilot_stack[i]->timer[j] -= t;
}
@ -50,8 +51,9 @@ static void pilots_unpause(void) {
int i, j;
unsigned int t = SDL_GetTicks();
for(i = 0; i < pilots; i++) {
pilot_stack[i]->tcontrol += t;
pilot_stack[i]->ptimer += t;
pilot_stack[i]->tcontrol += t;
for(j = 0; j < MAX_AI_TIMERS; j++)
pilot_stack[i]->timer[j] += t;
}

View File

@ -252,7 +252,8 @@ static void pilot_update(Pilot* pilot, const double dt) {
if(!pilot_isFlag(pilot, PILOT_HYPERSPACE) && VMOD(pilot->solid->vel) >
pilot->ship->speed)
// Should not go faster.
vect_pset(&pilot->solid->vel, pilot->ship->speed, VANGLE(pilot->solid->vel));
vect_pset(&pilot->solid->vel, VMOD(pilot->solid->vel) - 0.3*pilot->ship->thrust*dt,
VANGLE(pilot->solid->vel));
}
// Pilot is getting ready or is in, hyperspace.

View File

@ -940,8 +940,8 @@ void player_brokeHyperspace(void) {
space_init(systems[cur_system->jumps[hyperspace_target]].name);
// Set position, pilot_update will handle the lowering of velocity.
player_warp(-cos(player->solid->dir) * MIN_HYPERSPACE_DIST * 1.2,
-sin(player->solid->dir) * MIN_HYPERSPACE_DIST * 1.2);
player_warp(-cos(player->solid->dir) * MIN_HYPERSPACE_DIST * 1.5,
-sin(player->solid->dir) * MIN_HYPERSPACE_DIST * 1.5);
// Stop hyperspace.
pilot_rmFlag(player, PILOT_HYPERSPACE | PILOT_HYP_BEGIN | PILOT_HYP_PREP);