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

Check hp_max > 0 for entities #12667

Merged
merged 1 commit into from Aug 13, 2022
Merged

Conversation

appgurueu
Copy link
Contributor

@appgurueu appgurueu commented Aug 8, 2022

Since 5.6.0, a zero max HP leads to entities being deactivated even before on_activate is called (i.e. entities are "gone" immediately even before they are added because they are initialized with 0 HP). This is a massive footgun for modders, which somehow have awesome ideas like using hp_max = 0.5. This PR adds basic validation for hp_max > 0 whenever properties are set.

@sfan5 sfan5 added the Bugfix 🐛 PRs that fix a bug label Aug 8, 2022
@sfan5
Copy link
Member

sfan5 commented Aug 8, 2022

Is hp_max only respected since 5.6 or how did this happen?

Edit: nevermind, this is another side effect of 303329f.
It was previously possible to keep an entity at hp 0 without it dying, it would only die by punches. (I still consider this a bug)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants