@@ -2307,7 +2307,7 @@ Player::collision_tile(uint32_t tile_attributes)
2307
2307
}
2308
2308
2309
2309
void
2310
- Player::collision_solid (const CollisionHit& hit)
2310
+ Player::handle_collision_logic (const CollisionHit& hit)
2311
2311
{
2312
2312
if (hit.bottom ) {
2313
2313
if (m_physic.get_velocity_y () > 0 )
@@ -2360,6 +2360,12 @@ Player::collision_solid(const CollisionHit& hit)
2360
2360
m_boost = 0 .f ;
2361
2361
}
2362
2362
2363
+ void
2364
+ Player::collision_solid (const CollisionHit& hit)
2365
+ {
2366
+ handle_collision_logic (hit);
2367
+ }
2368
+
2363
2369
HitResponse
2364
2370
Player::collision (MovingObject& other, const CollisionHit& hit)
2365
2371
{
@@ -2392,31 +2398,8 @@ Player::collision(MovingObject& other, const CollisionHit& hit)
2392
2398
return FORCE_MOVE;
2393
2399
if (m_stone)
2394
2400
return ABORT_MOVE;
2395
- if (badguy->is_frozen () && hit.bottom && badguy->get_physic ().get_velocity_y () != 0 ) {
2396
- if (m_physic.get_velocity_y () > 0 )
2397
- m_physic.set_velocity_y (0 );
2398
-
2399
- m_on_ground_flag = true ;
2400
- m_floor_normal = hit.slope_normal ;
2401
- m_is_slidejump_falling = false ;
2402
- m_slidejumping = false ;
2403
-
2404
- // Butt Jump landed
2405
- if (m_does_buttjump) {
2406
- m_does_buttjump = false ;
2407
- m_buttjump_stomp = true ;
2408
- m_physic.set_velocity_y (-300 );
2409
- m_on_ground_flag = false ;
2410
- Sector::get ().add <Particles>(
2411
- m_col.m_bbox .p2 (),
2412
- 50 , 70 , 260 , 280 , Vector (0 , 300 ), 3 ,
2413
- Color (.4f , .4f , .4f ), 3 , .8f , LAYER_OBJECTS+1 );
2414
- Sector::get ().add <Particles>(
2415
- Vector (m_col.m_bbox .get_left (), m_col.m_bbox .get_bottom ()),
2416
- -70 , -50 , 260 , 280 , Vector (0 , 300 ), 3 ,
2417
- Color (.4f , .4f , .4f ), 3 , .8f , LAYER_OBJECTS+1 );
2418
- Sector::get ().get_camera ().shake (.1f , 0 .f , 10 .f );
2419
- }
2401
+ if (badguy->is_frozen () && badguy->get_physic ().get_velocity_y () != 0 ) {
2402
+ handle_collision_logic (hit);
2420
2403
}
2421
2404
}
2422
2405
0 commit comments