Cataclysm-DDA icon indicating copy to clipboard operation
Cataclysm-DDA copied to clipboard

Code fix for #71971 Water purification tablets only purify up to 4 water each

Open PatrikLundell opened this issue 1 year ago • 3 comments

Summary

None

Purpose of change

Fix compilation errors in #71971, requested by @Maleclypse for merge into that PR.

Describe the solution

  • Adapt to typification (conversion to tripoint_bub_ms from untyped tripoint).
  • Add missing constants in tests. No idea why they weren't there.
  • Change failed usage of protected field to use the corresponding operation in line with other usage.

Describe alternatives you've considered

Just do the tripoints.

Testing

Loaded a "random" save without any crashes or error messages.

Additional context

As stated above, this PR is intended to be used "sideways". As such, I didn't bother to give this PR a readable title, just a PR number reference, which I strongly discourage in general practice.

PatrikLundell avatar Sep 10 '24 12:09 PatrikLundell

The failed test is caused by master code, which contains the dubious practice of naming a variable the same as the type. It's probably caused by the rework of eggs and baby monsters, and should be dealt with separated from unrelated PRs.

PatrikLundell avatar Sep 10 '24 19:09 PatrikLundell

I appreciate how you've done this and you've kept the commits intact better than I'd be able to do so. Since this is a fully superseding version inclusive of commits and I was able to compile and test this I'm going to merge this if that's ok.
water purify tablets work

Maleclypse avatar Sep 10 '24 22:09 Maleclypse

Do what you think is best. I don't care about credits etc. but @ZeroInternalReflection might.

I've done nothing to keep commits intact: it's all how it happened to end up when I followed the instructions on how to get hold of and upload the changed code.

PatrikLundell avatar Sep 11 '24 07:09 PatrikLundell

Normally in situations like this we don't squash commits even if they had a bunch of gibberish commits in here to preserve credit. This doesn't have a lot of gibberish commits so it's an even easier merge.

Maleclypse avatar Sep 12 '24 15:09 Maleclypse

Also apparently github recognized this was a continuation of the PR and counts it as merged as well

Maleclypse avatar Sep 12 '24 15:09 Maleclypse

Should water purification tablets not purify 6 each since they are designed to purify a one quart canteen?

Severhead avatar Sep 12 '24 15:09 Severhead

Should water purification tablets not purify 6 each since they are designed to purify a one quart canteen?

It is best to make an issue when you suspect changes need to be made to an already merged PR. Especially in this case where the author of this PR updated the mapgen parts of an earlier abandoned PR. Making a new issue will make it more likely that someone who will do something about the issue you are raising will see it.

Maleclypse avatar Sep 12 '24 16:09 Maleclypse

I just saw the notifications for this getting merged and had to track down my GitHub password. Thanks for getting this over the finish line.

Now, hopefully there weren't any bugs left in my cod- Oh. Yeah, I definitely should have split the 'consuming water you've backed out of consuming' bug into a separate PR. If I remember correctly, the code is fairly isolated, and reverting it until someone with better understanding of item_locations and the activity actor code can tackle it is probably the best option. Unfortunately, I'm not really set up to test it right now.

ZeroInternalReflection avatar Sep 16 '24 00:09 ZeroInternalReflection