File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -200,12 +200,18 @@ WalkingBadguy::collision_solid(const CollisionHit& hit)
200
200
if (m_physic.get_velocity_y () > 0 ) m_physic.set_velocity_y (0 );
201
201
}
202
202
203
- if ( hit.slope_normal .x == 0 .0f &&
204
- ((hit.left && m_dir == Direction::LEFT) ||
205
- (hit.right && m_dir == Direction::RIGHT)) ) {
203
+ if ((hit.left && m_dir == Direction::LEFT) ||
204
+ (hit.right && m_dir == Direction::RIGHT)) {
205
+
206
+ // Enemies get stuck in some tiles #3239 FIX
207
+ // When a bad guy is about to step onto a slope, have it manually step onto it
208
+ if (std::abs (hit.slope_normal .x ) > 0 .0f && std::abs (hit.slope_normal .x ) < 0 .7f ) {
209
+ m_col.m_bbox .move (Vector (0 , -5 ));
210
+ } else {
211
+ // If it's anything but a sloped surface, turn around like normal
206
212
turn_around ();
213
+ }
207
214
}
208
-
209
215
}
210
216
211
217
HitResponse
You can’t perform that action at this time.
0 commit comments