minetest-mods / stamina

Adds hunger (stamina) to minetest.
17 stars 18 forks source link

fix privilege check #25

Closed fluxionary closed 5 years ago

fluxionary commented 5 years ago

The privilege check was backwards; This resulted in players with the interact privilege not being able to lose or gain stamina once their stamina dropped below the heal threshold. I assume players w/out interact would still starve to death :)

Note that minetest.check_player_privs(player, {interact=false}) is semantically identical to minetest.check_player_privs(player, {interact=true}).

int-ua commented 5 years ago

Note that minetest.check_player_privs(player, {interact=false}) is semantically identical to minetest.check_player_privs(player, {interact=true}).

Thank you. It should be documented. Also I haven't found a way to revoke interact priv on singleplayer for testing the change so I had to send it without testing.

fluxionary commented 5 years ago

@int-ua :

I haven't found a way to revoke interact priv on singleplayer for testing the change so I had to send it without testing.

For that, I'd recommend running a local server - just check the "Host Server" box before you start your world (but make sure not to check "Announce Server"). You can also fiddle your single-player privs in the auth db, but that's more complicated.