-
-
Notifications
You must be signed in to change notification settings - Fork 492
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix max drop height on slopes #2812
Conversation
Few bugs I found:
|
@@ -230,7 +230,7 @@ class BadGuy : public MovingSprite, | |||
|
|||
/** Returns true if we might soon fall at least @c height | |||
pixels. Minimum value for height is 1 pixel */ | |||
bool might_fall(int height = 1) const; | |||
bool might_fall(int height = 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you tell me why this method is no longer const? Do we modify the object state with the changes? And if so: Could we prevent that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It changes m_detected_slope. I do this because I want to prevent having two raycasts at a time. So to fix that I alternate between them by checking if m_detected_slope is 0 or not.
@@ -99,7 +99,7 @@ void WalkingBadguy::set_ledge_behavior(LedgeBehavior behavior) | |||
break; | |||
|
|||
case LedgeBehavior::SMART: | |||
max_drop_height = static_cast<int>(get_bbox().get_width()) / 2; | |||
max_drop_height = 16.f; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this number have any significance? Seems like a magic number. Just curious.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's half a tile
Left - how it acts with this PR |
for example mr tree now falls off 1 tile ledges and walking badguys cant walk up some slopes