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 crash on wield from inventory #28318

Closed

Conversation

Projects
None yet
2 participants
@ifreund
Copy link
Contributor

commented Feb 22, 2019

Summary

SUMMARY: None

Purpose of change

Fix crash on wield from inventory caused by #28312
Edit: Fixes #28319

Describe the solution

Passing the item by reference in #28312 broke the target pointer, causing bad things to happen when trying to remove it from the source location. This pr restructures the code to always remove the item before trying to wield, then replace it if the wield does not succeed. Probably should have done it that way to start with looking back.

@kevingranade

This comment has been minimized.

Copy link
Member

commented Feb 22, 2019

This pull request has been mentioned on Cataclysm: Dark Days Ahead. There might be relevant details there:

https://discourse.cataclysmdda.org/t/problem-wielding/18901/5

@kevingranade

This comment has been minimized.

Copy link
Member

commented Feb 23, 2019

Merged to 0.D and master.

@ifreund ifreund referenced this pull request Feb 23, 2019

Closed

Weapon Wield Crash #28328

@ifreund ifreund deleted the ifreund:fix-inventory-wield-crash branch Mar 3, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.