-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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 the casing ejection behavior of The Disorder sledgehammer #59323
Fix the casing ejection behavior of The Disorder sledgehammer #59323
Conversation
…Disorder to "tool" instead of "generic"
Ok, I got visual studio to behave for a while. Unfortunately it seems that the disorder refuses to expend its ammo at all. I also tried using it on the master branch and sure enough; I can't get it to expend its ammo, even when the technique procs. So it's not a result of my PR, but I'm not even able to replicate the bug that this PR is meant to fix. I swear it worked fine a couple months ago. so...yeah 🤷 |
Hmmm yeah it worked when I originally PRd it 🤔 If this doesn't solve the issue can you mark it as draft so no one yolo merges it? I'm not apposed to this being fixed but if you've tested this and it doesn't solve it then yah know. |
Just to clarify; this PR should fix the casings ejection issue, but it's impossible to test unless the weapon actually produces casings. |
https://github.com/CleverRaven/Cataclysm-DDA/blame/master/src/melee.cpp#L1638 I think it's this line that broke it, thanks for letting me know, I'm gonna try and write a simple unit test tonight for it expending ammo 😄 |
Finished testing. After #59474 everything seems to work correctly 👍 |
Summary
Bugfixes "Fix the casing ejection behavior of The Disorder sledgehammer"
Purpose of change
Fixes #57683
Describe the solution
Adjusted casings_handle() to work on tools, instead of only working on guns.
Changed the item type of Disorder to "tool" instead of "generic"
Describe alternatives you've considered
Removing the check that makes the casing handler only work on guns. Doing this seems like it would almost certainly break something, so I'd prefer not to do that.
Changed the item type of Disorder to "gun." Doing this requires adding a whole bunch of gun data that would basically turn it into a ranged weapon, which is not what I want to do.
Testing
I've been having some issues with visual studio, so I haven't been able to properly test it myself yet. Once I can, the steps will be:The Disorder should now contain an empty casing for the 22 blank.
The empty casing should now be in your backpack or some other place in your inventory.
Edit: testing is done, everything works correctly.
Additional context
Note that trying to pick up an item between steps 3 and 4 will cause the empty casings to fall on the ground. This happens with other weapons too, so it seems like a separate issue.