aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--builtin/client/cheats/init.lua2
-rw-r--r--builtin/settingtypes.txt4
-rw-r--r--src/client/game.cpp2
-rw-r--r--src/client/localplayer.cpp4
-rw-r--r--src/defaultsettings.cpp2
5 files changed, 11 insertions, 3 deletions
diff --git a/builtin/client/cheats/init.lua b/builtin/client/cheats/init.lua
index 69dbac02a..b8facae9d 100644
--- a/builtin/client/cheats/init.lua
+++ b/builtin/client/cheats/init.lua
@@ -9,6 +9,7 @@ core.cheats = {
["AutoTotem"] = "autototem",
["ThroughWalls"] = "dont_point_nodes",
["OnlyTracePlayers"] = "only_trace_players",
+ ["AutoHit"] = "autohit",
},
["Movement"] = {
["Freecam"] = "freecam",
@@ -22,6 +23,7 @@ core.cheats = {
["SpeedOverride"] = "override_speed",
["JumpOverride"] = "override_jump",
["GravityOverride"] = "override_gravity",
+ ["JetPack"] = "jetpack",
},
["Render"] = {
["Xray"] = "xray",
diff --git a/builtin/settingtypes.txt b/builtin/settingtypes.txt
index f91603ff4..477b059c8 100644
--- a/builtin/settingtypes.txt
+++ b/builtin/settingtypes.txt
@@ -2367,3 +2367,7 @@ override_speed_factor (SpeedOverride Factor) float 1.2
override_jump_factor (JumpOverride Factor) float 2.0
override_gravity_factor (GravityOverride) float 0.8
+
+jetpack (JetPack) bool false
+
+autohit (AutoHit) bool false
diff --git a/src/client/game.cpp b/src/client/game.cpp
index 93ec186c6..88607d1d8 100644
--- a/src/client/game.cpp
+++ b/src/client/game.cpp
@@ -2811,7 +2811,7 @@ void Game::handlePointingAtObject(const PointedThing &pointed,
m_game_ui->setInfoText(infotext);
- if (input->getLeftState()) {
+ if (input->getLeftState() || g_settings->getBool("autohit")) {
bool do_punch = false;
bool do_punch_damage = false;
diff --git a/src/client/localplayer.cpp b/src/client/localplayer.cpp
index 00195cd02..0da76845a 100644
--- a/src/client/localplayer.cpp
+++ b/src/client/localplayer.cpp
@@ -611,14 +611,14 @@ void LocalPlayer::applyControl(float dtime, Environment *env)
else
speedV.Y = movement_speed_walk;
}
- } else if (m_can_jump) {
+ } else if (m_can_jump || g_settings->getBool("jetpack")) {
/*
NOTE: The d value in move() affects jump height by
raising the height at which the jump speed is kept
at its starting value
*/
v3f speedJ = getSpeed();
- if (speedJ.Y >= -0.5f * BS) {
+ if (speedJ.Y >= -0.5f * BS || g_settings->getBool("jetpack")) {
speedJ.Y = movement_speed_jump * physics_override_jump;
setSpeed(speedJ);
m_client->getEventManager()->put(new SimpleTriggerEvent(MtEvent::PLAYER_JUMP));
diff --git a/src/defaultsettings.cpp b/src/defaultsettings.cpp
index bb9c47dc8..8addb72eb 100644
--- a/src/defaultsettings.cpp
+++ b/src/defaultsettings.cpp
@@ -142,6 +142,8 @@ void set_default_settings(Settings *settings)
settings->setDefault("override_speed_factor", "1.2");
settings->setDefault("override_jump_factor", "2.0");
settings->setDefault("override_gravity_factor", "0.9");
+ settings->setDefault("jetpack", "false");
+ settings->setDefault("autohit", "false");
// Keymap
settings->setDefault("remote_port", "30000");