aboutsummaryrefslogtreecommitdiff
path: root/src/client/localplayer.h
diff options
context:
space:
mode:
authorElias Fleckenstein <eliasfleckenstein@web.de>2021-03-26 13:15:13 +0100
committerElias Fleckenstein <eliasfleckenstein@web.de>2021-03-26 13:15:13 +0100
commit138a002cf7593c9bc464fcea8d122df71f4b99ef (patch)
treeb3bb5cf2c1f394dba0812cef7eb9188ea50ffff7 /src/client/localplayer.h
parente0b4859e7c904232253905571721003a2cb76040 (diff)
parent63f7c96ec20724aef1ed03bae0793db892cf23d5 (diff)
downloaddragonfireclient-138a002cf7593c9bc464fcea8d122df71f4b99ef.tar.xz
Merge branch 'master' of https://github.com/EliasFleckenstein03/dragonfireclient
Diffstat (limited to 'src/client/localplayer.h')
-rw-r--r--src/client/localplayer.h20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/client/localplayer.h b/src/client/localplayer.h
index 0e071d2b4..842c18015 100644
--- a/src/client/localplayer.h
+++ b/src/client/localplayer.h
@@ -140,8 +140,8 @@ public:
v3f getPosition() const { return m_position; }
v3f getLegitPosition() const { return m_legit_position; }
-
- v3f getLegitSpeed() const { return m_legit_speed; }
+
+ v3f getLegitSpeed() const { return m_freecam ? m_legit_speed : m_speed; }
inline void setLegitPosition(const v3f &position)
{
@@ -151,18 +151,18 @@ public:
setPosition(position);
}
- inline void freecamEnable()
+ inline void freecamEnable()
{
m_freecam = true;
}
-
- inline void freecamDisable()
+
+ inline void freecamDisable()
{
m_freecam = false;
setPosition(m_legit_position);
setSpeed(m_legit_speed);
}
-
+
// Non-transformed eye offset getters
// For accurate positions, use the Camera functions
v3f getEyePosition() const { return m_position + getEyeOffset(); }
@@ -184,13 +184,13 @@ public:
{
added_velocity += vel;
}
-
+
void tryReattach(int id);
-
+
bool isWaitingForReattach() const;
-
+
bool canWalkOn(const ContentFeatures &f);
-
+
private:
void accelerate(const v3f &target_speed, const f32 max_increase_H,
const f32 max_increase_V, const bool use_pitch);