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

Don't damage armor when drowning, eating or starving. #6

Merged
merged 1 commit into from
Apr 30, 2020

Conversation

orbea
Copy link

@orbea orbea commented Apr 29, 2020

Fixes stujones11#119.

Note for a hunger mod to properly support this they must give the reason when changing the player's health. The changes for the hunger_ng mod were merged, but I haven't looked at any other hunger mods.

https://gitlab.com/4w/hunger_ng/-/merge_requests/8
https://gitlab.com/4w/hunger_ng/-/commit/7a0c18cdd8b1385c6e145a68b40cbbe3a27c2174

Instead of checking the specific reason, I am checking only whether reason.hunger is nil or not. I think armor should not be damaged from eating foods or starving regardless of the reason?

@BuckarooBanzay
Copy link
Member

Looks good 👍 thanks.

I'm using the stamina mod mostly and it doesn't set the reason parameter (yet):
https://github.com/minetest-mods/stamina/blob/0dc0e2a226b796974423ad50de6e6c0c88b19452/init.lua#L396

This does provide a backward compatible way to improve things like that..

@BuckarooBanzay BuckarooBanzay merged commit acd8b26 into minetest-mods:master Apr 30, 2020
@orbea orbea deleted the damage branch April 30, 2020 08:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Hunger damages armor
2 participants