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

HUD: Reject and warn on invalid stat types #11548

Merged
merged 2 commits into from
Aug 21, 2021

Conversation

SmallJoker
Copy link
Member

@SmallJoker SmallJoker commented Aug 17, 2021

Trivial fix for #11539

To do

This PR is Ready for Review.

How to test

  1. Check whether HUD element changes still work, for example using /hudfonts in devtest
  2. Modify hud_change calls to change TEXT or sTyLe and observe unique logs

@SmallJoker SmallJoker added Trivial The change is a trivial bug fix, documentation or maintenance change, as per the Git Guidelines Bugfix 🐛 PRs that fix a bug WIP The PR is still being worked on by its author and not ready yet. labels Aug 17, 2021
@AFCMS
Copy link
Contributor

AFCMS commented Aug 17, 2021

Why WIP label and "Ready for review" ?

This comes into play on older servers which do not know the "stat" type.
Warnings are only logged once to aboid spam within globalstep callbacks
@SmallJoker SmallJoker removed the WIP The PR is still being worked on by its author and not ready yet. label Aug 17, 2021
@SmallJoker SmallJoker changed the title HUD: Do not assume int values on unknown HUD types HUD: Reject and warn on invalid stat types Aug 17, 2021
break;
default:
*pkt >> intdata;
return;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

replace with break, else you discard data

@SmallJoker SmallJoker removed the Trivial The change is a trivial bug fix, documentation or maintenance change, as per the Git Guidelines label Aug 19, 2021
@sfan5
Copy link
Member

sfan5 commented Aug 19, 2021

I don't see anything logged when executing executed core.get_player_by_name("singleplayer"):hud_change(3, "WRONG", 1) though the hud packet doesn't go out.

@SmallJoker SmallJoker merged commit 0c1e960 into minetest:master Aug 21, 2021
@SmallJoker SmallJoker deleted the no_hud_fallback branch June 4, 2022 19:08
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

4 participants