aboutsummaryrefslogtreecommitdiff
path: root/src/client/game.cpp
diff options
context:
space:
mode:
authorHerman Semenov <GermanAizek@yandex.ru>2022-09-06 13:21:09 +0300
committerGitHub <noreply@github.com>2022-09-06 11:21:09 +0100
commit038da00e799b4bf3af824075a260083c56392964 (patch)
tree8c0e3218455073684c2521cec41b7df06fff8598 /src/client/game.cpp
parentff6dcfea82974df6db5a557e31aaddb6bdb7a71f (diff)
downloadminetest-038da00e799b4bf3af824075a260083c56392964.tar.xz
Code optimizations / refactor (#12704)
Co-authored-by: SmallJoker <SmallJoker@users.noreply.github.com> Co-authored-by: sfan5 <sfan5@live.de>
Diffstat (limited to 'src/client/game.cpp')
-rw-r--r--src/client/game.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/client/game.cpp b/src/client/game.cpp
index 34bfb5aa6..6a4bff61a 100644
--- a/src/client/game.cpp
+++ b/src/client/game.cpp
@@ -112,7 +112,7 @@ struct TextDestPlayerInventory : public TextDest
TextDestPlayerInventory(Client *client)
{
m_client = client;
- m_formname = "";
+ m_formname.clear();
}
TextDestPlayerInventory(Client *client, const std::string &formname)
{
@@ -2985,14 +2985,15 @@ void Game::updateCamera(f32 dtime)
camera->update(player, dtime, tool_reload_ratio);
camera->step(dtime);
- v3f camera_position = camera->getPosition();
- v3f camera_direction = camera->getDirection();
f32 camera_fov = camera->getFovMax();
v3s16 camera_offset = camera->getOffset();
m_camera_offset_changed = (camera_offset != old_camera_offset);
if (!m_flags.disable_camera_update) {
+ v3f camera_position = camera->getPosition();
+ v3f camera_direction = camera->getDirection();
+
client->getEnv().getClientMap().updateCamera(camera_position,
camera_direction, camera_fov, camera_offset);
@@ -3149,7 +3150,7 @@ void Game::processPlayerInteraction(f32 dtime, bool show_hud)
runData.punching = false;
- soundmaker->m_player_leftpunch_sound.name = "";
+ soundmaker->m_player_leftpunch_sound.name.clear();
// Prepare for repeating, unless we're not supposed to
if (isKeyDown(KeyType::PLACE) && !g_settings->getBool("safe_dig_and_place"))