Skip to content

Commit 4247613

Browse files
committed
Fix ship fallspeed
1 parent cdaa7b4 commit 4247613

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

SAUCE/gamemodes/gamemode_ship.h

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,24 +11,26 @@ void is_player_falling() {
1111
void ship_movement(){
1212
is_player_falling();
1313

14-
if (controllingplayer->a || controllingplayer->up) { // holding
14+
tmp2 = (controllingplayer->a || controllingplayer->up); // input
15+
16+
if (tmp2) { // holding
1517
tmpgravity = SHIP_GRAVITY_BASE(currplayer_table_idx);
1618
} else if (
17-
!(controllingplayer->a || controllingplayer->up) && // not holding
19+
!tmp2 && // not holding
1820
!tmp1 // not falling
1921
){
2022
tmpgravity = SHIP_GRAVITY_AFTER_HOLD(currplayer_table_idx);
2123
} else {
2224
tmpgravity = SHIP_GRAVITY(currplayer_table_idx);
2325
}
2426

25-
if ((controllingplayer->a || controllingplayer->up) && // holding
27+
if (tmp2 && // holding
2628
tmp1 // falling
2729
){
2830
tmpgravity = SHIP_GRAVITY_HOLD_FALL(currplayer_table_idx);
2931
}
3032

31-
if ((controllingplayer->a || controllingplayer->up) ^ (currplayer_gravity ? 1 : 0)) {
33+
if (tmp2 ^ (currplayer_gravity ? 1 : 0)) {
3234
tmpgravity = -tmpgravity;
3335
}
3436

@@ -46,6 +48,8 @@ void ship_movement(){
4648
tmpfallspeed = (currplayer_gravity ? tmpfallspeedtop : tmpfallspeedbot);
4749
if(currplayer_vel_y > tmpfallspeed) currplayer_vel_y = tmpfallspeed;
4850

51+
tmpfallspeed = tmpfallspeedtop;
52+
4953
#undef tmpfallspeedtop
5054
#undef tmpfallspeedbot
5155

0 commit comments

Comments
 (0)