Skip to content

Commit

Permalink
Tools: Fix tool digging speed limit
Browse files Browse the repository at this point in the history
  • Loading branch information
HybridDog authored and paramat committed Apr 19, 2017
1 parent cf37a55 commit 858c722
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 11 deletions.
5 changes: 2 additions & 3 deletions doc/lua_api.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1231,9 +1231,8 @@ Another example: Make red wool from white wool and red dye:
* `0` is something that is directly accessible at the start of gameplay
* There is no upper limit
* `dig_immediate`: (player can always pick up node without tool wear)
* `2`: node is removed without tool wear after 0.5 seconds or so
(rail, sign)
* `3`: node is removed without tool wear immediately (torch)
* `2`: node is removed without tool wear after 0.5 seconds (rail, sign)
* `3`: node is removed without tool wear after 0.15 seconds (torch)
* `disable_jump`: Player (and possibly other things) cannot jump from node
* `fall_damage_add_percent`: damage speed = `speed * (1 + value/100)`
* `bouncy`: value is bounce speed in percent
Expand Down
7 changes: 0 additions & 7 deletions src/game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3888,13 +3888,6 @@ void Game::handleDigging(const PointedThing &pointed, const v3s16 &nodepos,
if (runData.nodig_delay_timer > 0.3)
runData.nodig_delay_timer = 0.3;

// We want a slight delay to very little
// time consuming nodes
const float mindelay = 0.15;

if (runData.nodig_delay_timer < mindelay)
runData.nodig_delay_timer = mindelay;

bool is_valid_position;
MapNode wasnode = map.getNodeNoEx(nodepos, &is_valid_position);
if (is_valid_position) {
Expand Down
2 changes: 1 addition & 1 deletion src/tool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ DigParams getDigParams(const ItemGroupList &groups,
return DigParams(true, 0.5, 0, "dig_immediate");
case 3:
//infostream<<"dig_immediate=3"<<std::endl;
return DigParams(true, 0.0, 0, "dig_immediate");
return DigParams(true, 0.15, 0, "dig_immediate");
default:
break;
}
Expand Down

0 comments on commit 858c722

Please sign in to comment.