Skip to content

Add delay between punching and digging node#15931

Merged
cx384 merged 1 commit intoluanti-org:masterfrom
ryvnf:digdelay
Apr 4, 2025
Merged

Add delay between punching and digging node#15931
cx384 merged 1 commit intoluanti-org:masterfrom
ryvnf:digdelay

Conversation

@ryvnf
Copy link
Contributor

@ryvnf ryvnf commented Mar 23, 2025

Currently there is no delay between punching an entity and starting to dig a node. If the digging time for the node behind it is instant, it is practically impossible to kill an entity and not accidentally dig the node behind it.

This adds a delay of max(0.15, m_repeat_dig_time) after punching an entity to avoid this. Because m_repeat_dig_time defaults to 0 clamping it to a minimum value is necessary. I used 0.15 because that is the hardcoded digging delay between breaking nodes with instant digging time.

How to test

  1. Play Mineclonia and play on a world which has creative mode (which has instant digging with hand)
  2. Give yourself a netherite sword
  3. Punch the rabbit
    • On main the block behind it will be immediately broken
    • On this branch it will not be immediately broken
  4. Try increasing the repeat_dig_time
    • Punch rabbit and hold dig button
    • Notice that the delay between killing the entity and digging the node behind it is increased

@sfan5 sfan5 added Feature ✨ PRs that add or enhance a feature @ Client / Controls / Input labels Mar 23, 2025
@Zughy Zughy added the Roadmap The change matches an item on the current roadmap label Mar 23, 2025
@sfan5 sfan5 self-requested a review March 25, 2025 12:03
Copy link
Member

@sfan5 sfan5 left a comment

Choose a reason for hiding this comment

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

works

@sfan5 sfan5 added this to the 5.12.0 milestone Apr 1, 2025
Copy link
Member

@Desour Desour left a comment

Choose a reason for hiding this comment

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

Works. 👍

(Also allows to pick up items without punching the node behind, if you want to reproduce easily.)

(Taking the same time as for dig_instantly makes sense.)

@cx384 cx384 merged commit 1db5a2f into luanti-org:master Apr 4, 2025
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

@ Client / Controls / Input Feature ✨ PRs that add or enhance a feature Roadmap The change matches an item on the current roadmap >= Two approvals ✅ ✅

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

Comments