# The time in seconds it takes between repeated right clicks when holding the right mouse button.
repeat_rightclick_time (Rightclick repetition interval) float 0.25
+# Prevent digging and placing from repeating when holding the mouse buttons.
+# Enable this when you dig or place too often by accident.
+safe_dig_and_place (Safe digging and placing) bool false
+
# Enable random user input (only used for testing).
random_input (Random input) bool false
# type: float
# repeat_rightclick_time = 0.25
+# Prevent digging and placing from repeating when holding the mouse buttons.
+# Enable this when you dig or place too often by accident.
+# type: bool
+# safe_dig_and_place = false
+
# Enable random user input (only used for testing).
# type: bool
# random_input = false
settings->setDefault("invert_mouse", "false");
settings->setDefault("mouse_sensitivity", "0.2");
settings->setDefault("repeat_rightclick_time", "0.25");
+ settings->setDefault("safe_dig_and_place", "false");
settings->setDefault("random_input", "false");
settings->setDefault("aux1_descends", "false");
settings->setDefault("doubletap_jump", "false");
bool digging;
bool ldown_for_dig;
bool dig_instantly;
+ bool digging_blocked;
bool left_punch;
bool update_wielded_item_trigger;
bool reset_jump_timer;
hud->updateSelectionMesh(camera_offset);
}
+ if (runData.digging_blocked && !isLeftPressed()) {
+ // allow digging again if button is not pressed
+ runData.digging_blocked = false;
+ }
+
/*
Stop digging when
- releasing left mouse button
soundmaker->m_player_leftpunch_sound.name = "";
- if (isRightPressed())
+ // Prepare for repeating, unless we're not supposed to
+ if (isRightPressed() && !g_settings->getBool("safe_dig_and_place"))
runData.repeat_rightclick_timer += dtime;
else
runData.repeat_rightclick_timer = 0;
ClientMap &map = client->getEnv().getClientMap();
if (runData.nodig_delay_timer <= 0.0 && isLeftPressed()
+ && !runData.digging_blocked
&& client->checkPrivilege("interact")) {
handleDigging(pointed, nodepos, playeritem_toolcap, dtime);
}
runData.dig_time = 0;
runData.digging = false;
+ // we successfully dug, now block it from repeating if we want to be safe
+ if (g_settings->getBool("safe_dig_and_place"))
+ runData.digging_blocked = true;
runData.nodig_delay_timer =
runData.dig_time_complete / (float)crack_animation_length;