Skip to content

Conversation

@Niklp09
Copy link
Member

@Niklp09 Niklp09 commented Oct 28, 2025

Resolves #47

  • Take the node at the player's head into account (both must be "fully solid"/"stone like")
  • Reduce damage per step (1 seems appropriate)
  • No negative impact on performance

@Niklp09 Niklp09 requested a review from SwissalpS October 28, 2025 19:41
@Niklp09 Niklp09 added the enhancement New feature or request label Oct 28, 2025
Comment on lines +21 to +25
if is_solid_node(pos) then
pos.y = pos.y + 1 -- Player's head
if is_solid_node(pos)
and player:get_hp() > 0
and not core.check_player_privs(player:get_player_name(), { noclip = true }) then
Copy link
Contributor

Choose a reason for hiding this comment

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

Possible micro-optimization: if the priv check goes first, sometimes the other checks could be skipped.
I'm not sure that is worth it as noclip players are rather rare.

Maybe checking hp first can skip checking dead players' nodes over and over for nothing.

Copy link
Contributor

@SwissalpS SwissalpS left a comment

Choose a reason for hiding this comment

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

looks better, thanks. I approve with or without my nit-pick.

@Niklp09 Niklp09 merged commit 2aec289 into master Nov 1, 2025
2 checks passed
@Niklp09 Niklp09 deleted the noclip_hurt branch November 15, 2025 23:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

New no_clip anticheat is too strict

2 participants