@@ -186,28 +186,28 @@ void SetMovementStats(PlayerMovementStats *stats)
186
186
187
187
void DefaultAirMovement (Player *player)
188
188
{
189
+ if (player->YVelocity > -0x40000 && player->YVelocity < 0 )
190
+ player->speed -= player->speed >> 5 ;
191
+
189
192
if (player->speed <= -player->stats .topSpeed ) {
190
- if (player->left )
193
+ if (player->left ) {
191
194
player->direction = FLIP_X;
195
+ }
192
196
}
193
- else if (player->left ) {
194
- player->speed -= player->stats .airAcceleration ;
195
- player->direction = FLIP_X;
197
+ else {
198
+ if (player->left ) {
199
+ player->speed -= player->stats .airAcceleration ;
200
+ player->direction = FLIP_X;
201
+ }
196
202
}
197
203
198
204
if (player->speed >= player->stats .topSpeed ) {
199
205
if (player->right )
200
206
player->direction = FLIP_NONE;
201
207
}
202
208
else if (player->right ) {
203
- player->speed += player->stats .airAcceleration ;
204
209
player->direction = FLIP_NONE;
205
- }
206
-
207
- if (player->YVelocity > -0x4000 ) {
208
- if (player->YVelocity < 0 ) {
209
- player->speed -= player->speed >> 5 ;
210
- }
210
+ player->speed += player->stats .airAcceleration ;
211
211
}
212
212
}
213
213
@@ -248,7 +248,7 @@ void DefaultGravityTrue(Player *player)
248
248
249
249
void DefaultGroundMovement (Player *player)
250
250
{
251
- if ((sbyte )player->frictionLoss <= 0 ) {
251
+ if ((signed int )player->frictionLoss <= 0 ) {
252
252
if (player->left && player->speed > -player->stats .topSpeed ) {
253
253
if (player->speed <= 0 ) {
254
254
player->speed -= player->stats .acceleration ;
@@ -370,7 +370,7 @@ void DefaultGroundMovement(Player *player)
370
370
void DefaultJumpAction (Player *player)
371
371
{
372
372
player->frictionLoss = 0 ;
373
- player->gravity = 1 ;
373
+ player->gravity = true ;
374
374
player->XVelocity = (player->speed * cosVal256[player->angle ] + player->stats .jumpStrength * sinVal256[player->angle ]) >> 8 ;
375
375
player->YVelocity = (player->speed * sinVal256[player->angle ] + -player->stats .jumpStrength * cosVal256[player->angle ]) >> 8 ;
376
376
player->speed = player->XVelocity ;
@@ -388,6 +388,7 @@ void DefaultRollingMovement(Player *player)
388
388
player->speed += player->stats .rollingDeceleration ;
389
389
if (player->left && player->speed > 0 )
390
390
player->speed -= player->stats .rollingDeceleration ;
391
+
391
392
if (player->speed < 0 ) {
392
393
player->speed += player->stats .airDeceleration ;
393
394
if (player->speed > 0 )
@@ -403,14 +404,14 @@ void DefaultRollingMovement(Player *player)
403
404
404
405
if (player->speed <= 0 ) {
405
406
if (sinVal256[player->angle ] >= 0 ) {
406
- player->speed = (player->stats .rollingDeceleration * sinVal256[player->angle ] >> 8 ) + player-> speed ;
407
+ player->speed + = (player->stats .rollingDeceleration * sinVal256[player->angle ] >> 8 );
407
408
}
408
409
else {
409
410
player->speed += 0x5000 * sinVal256[player->angle ] >> 8 ;
410
411
}
411
412
}
412
413
else if (sinVal256[player->angle ] <= 0 ) {
413
- player->speed = (player->stats .rollingDeceleration * sinVal256[player->angle ] >> 8 ) + player-> speed ;
414
+ player->speed + = (player->stats .rollingDeceleration * sinVal256[player->angle ] >> 8 );
414
415
}
415
416
else {
416
417
player->speed += 0x5000 * sinVal256[player->angle ] >> 8 ;
0 commit comments