summaryrefslogtreecommitdiff
path: root/src/player.h
diff options
context:
space:
mode:
authorkwolekr <kwolekr@minetest.net>2015-03-31 23:33:30 -0400
committerkwolekr <kwolekr@minetest.net>2015-03-31 23:50:38 -0400
commitb4247dff2e003dd8c5ea5a1f3ae349d0bfab90bc (patch)
treedcbeac377204ba6b7024c92882f5be85b1d7562d /src/player.h
parent699e066beab969156223eb3b04cc04fde091fca2 (diff)
downloadminetest-b4247dff2e003dd8c5ea5a1f3ae349d0bfab90bc.tar.gz
minetest-b4247dff2e003dd8c5ea5a1f3ae349d0bfab90bc.tar.bz2
minetest-b4247dff2e003dd8c5ea5a1f3ae349d0bfab90bc.zip
Fix usage of destroyed mutex
Also fix a memory leak Fix overloaded virtual warning in Player::move() Remove some trailing whitespace
Diffstat (limited to 'src/player.h')
-rw-r--r--src/player.h17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/player.h b/src/player.h
index d4698ea4a..7d8d245e3 100644
--- a/src/player.h
+++ b/src/player.h
@@ -92,6 +92,9 @@ class PlayerSAO;
struct HudElement;
class Environment;
+// IMPORTANT:
+// Do *not* perform an assignment or copy operation on a Player or
+// RemotePlayer object! This will copy the lock held for HUD synchronization
class Player
{
public:
@@ -102,7 +105,7 @@ public:
virtual void move(f32 dtime, Environment *env, f32 pos_max_d)
{}
virtual void move(f32 dtime, Environment *env, f32 pos_max_d,
- std::list<CollisionInfo> *collision_info)
+ std::vector<CollisionInfo> *collision_info)
{}
v3f getSpeed()
@@ -114,7 +117,7 @@ public:
{
m_speed = speed;
}
-
+
void accelerateHorizontal(v3f target_speed, f32 max_increase);
void accelerateVertical(v3f target_speed, f32 max_increase);
@@ -252,7 +255,7 @@ public:
bool is_climbing;
bool swimming_vertical;
bool camera_barely_in_ceiling;
-
+
Inventory inventory;
f32 movement_acceleration_default;
@@ -285,15 +288,15 @@ public:
u16 peer_id;
std::string inventory_formspec;
-
+
PlayerControl control;
PlayerControl getPlayerControl()
{
return control;
}
-
+
u32 keyPressed;
-
+
HudElement* getHud(u32 id);
u32 addHud(HudElement* hud);
@@ -346,7 +349,7 @@ public:
void setPlayerSAO(PlayerSAO *sao)
{ m_sao = sao; }
void setPosition(const v3f &position);
-
+
private:
PlayerSAO *m_sao;
};