summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTheTermos <55103816+TheTermos@users.noreply.github.com>2020-07-03 17:21:42 +0200
committersfan5 <sfan5@live.de>2020-07-07 19:09:23 +0200
commitebb721a476ada0350b73fe44efa66850397b9e96 (patch)
tree42a0dcd8732c8a0c9c8438f5095bc52eef7ca44b /src
parent6e4d8de10442eecf71ba36ad015872a135a53338 (diff)
downloadminetest-ebb721a476ada0350b73fe44efa66850397b9e96.tar.gz
minetest-ebb721a476ada0350b73fe44efa66850397b9e96.tar.bz2
minetest-ebb721a476ada0350b73fe44efa66850397b9e96.zip
Fix player controls only being applied for the first move
Diffstat (limited to 'src')
-rw-r--r--src/client/client.cpp5
-rw-r--r--src/client/clientenvironment.cpp3
2 files changed, 4 insertions, 4 deletions
diff --git a/src/client/client.cpp b/src/client/client.cpp
index 34f97a9de..65e5b3d8c 100644
--- a/src/client/client.cpp
+++ b/src/client/client.cpp
@@ -459,12 +459,9 @@ void Client::step(float dtime)
/*
Handle environment
*/
- // Control local player (0ms)
LocalPlayer *player = m_env.getLocalPlayer();
- assert(player);
- player->applyControl(dtime, &m_env);
- // Step environment
+ // Step environment (also handles player controls)
m_env.step(dtime);
m_sound->step(dtime);
diff --git a/src/client/clientenvironment.cpp b/src/client/clientenvironment.cpp
index 44ea1e4a1..895b0193c 100644
--- a/src/client/clientenvironment.cpp
+++ b/src/client/clientenvironment.cpp
@@ -216,6 +216,9 @@ void ClientEnvironment::step(float dtime)
*/
{
+ // Control local player
+ lplayer->applyControl(dtime_part, this);
+
// Apply physics
if (!free_move && !is_climbing) {
// Gravity