Skip to content
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 garage door knockback crash #36671

Merged
merged 6 commits into from Jan 4, 2020
Merged

Fix garage door knockback crash #36671

merged 6 commits into from Jan 4, 2020

Conversation

ghost
Copy link

@ghost ghost commented Jan 3, 2020

Summary

SUMMARY: Bugfixes "Fix garage door knockback crash"

Purpose of change

Fixes #34963

Describe the solution

knockback() was passed two points from from forced_door_closing() though in some circumstances, that could pass two identical points, which caused crashes in slope_from() in line.cpp.

Used points_in_radius() instead of the previous rng method, and added checking for two identical points.

Describe alternatives you've considered

N/A

Testing

I cant actually reproduce the issue myself, but anothersimulacrum and others have been able to and they have tested this change.

Additional context

N/A

@ghost
Copy link
Author

ghost commented Jan 3, 2020

Never mind, this was just tested by anothersimulacrum who can repro the crash reliably, and its still crashing for them.

@ghost ghost closed this Jan 3, 2020
@ghost ghost reopened this Jan 3, 2020
@ghost
Copy link
Author

ghost commented Jan 3, 2020

Reopened as @anothersimulacrum has been assisting me with finding the real problem here for the real fix.

Copy link
Member

@anothersimulacrum anothersimulacrum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works correctly when I try it locally.

src/game.cpp Outdated Show resolved Hide resolved
@ZhilkinSerg ZhilkinSerg added <Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` labels Jan 3, 2020
@kevingranade
Copy link
Member

This has a teensy bug, it'll now prefer flinging in specific directions instead of it being random.

@kevingranade
Copy link
Member

Take a look at random_point() for how to pick a random point filtered by criteria.

@ghost
Copy link
Author

ghost commented Jan 4, 2020

yup, added that now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
<Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code`
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Closing Firestation door crashes game
3 participants