summaryrefslogtreecommitdiff
path: root/src/player.h
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2011-02-14 02:54:15 +0200
committerPerttu Ahola <celeron55@gmail.com>2011-02-14 02:54:15 +0200
commit14fafc72177fdc77bf8c8955363c77719f74e33b (patch)
treeff5e70feac29944b1a5acb1aa3d5ba7425d37e8c /src/player.h
parent0947c4cc48ec9aed0a831973e7e79f8d57d34bc3 (diff)
downloadminetest-14fafc72177fdc77bf8c8955363c77719f74e33b.tar.gz
minetest-14fafc72177fdc77bf8c8955363c77719f74e33b.tar.bz2
minetest-14fafc72177fdc77bf8c8955363c77719f74e33b.zip
added sneaking/crouching and changelog
Diffstat (limited to 'src/player.h')
-rw-r--r--src/player.h14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/player.h b/src/player.h
index 51e2320bc..27ce1f5aa 100644
--- a/src/player.h
+++ b/src/player.h
@@ -42,7 +42,7 @@ public:
void resetInventory();
//void move(f32 dtime, Map &map);
- virtual void move(f32 dtime, Map &map) = 0;
+ virtual void move(f32 dtime, Map &map, f32 pos_max_d) = 0;
v3f getSpeed()
{
@@ -147,7 +147,7 @@ public:
return false;
}
- virtual void move(f32 dtime, Map &map)
+ virtual void move(f32 dtime, Map &map, f32 pos_max_d)
{
}
@@ -240,7 +240,7 @@ public:
}
}
- void move(f32 dtime, Map &map);
+ void move(f32 dtime, Map &map, f32 pos_max_d);
private:
scene::IMeshSceneNode *m_node;
@@ -267,6 +267,7 @@ struct PlayerControl
right = false;
jump = false;
aux1 = false;
+ sneak = false;
pitch = 0;
yaw = 0;
}
@@ -277,6 +278,7 @@ struct PlayerControl
bool a_right,
bool a_jump,
bool a_aux1,
+ bool a_sneak,
float a_pitch,
float a_yaw
)
@@ -287,6 +289,7 @@ struct PlayerControl
right = a_right;
jump = a_jump;
aux1 = a_aux1;
+ sneak = a_sneak;
pitch = a_pitch;
yaw = a_yaw;
}
@@ -296,6 +299,7 @@ struct PlayerControl
bool right;
bool jump;
bool aux1;
+ bool sneak;
float pitch;
float yaw;
};
@@ -311,13 +315,15 @@ public:
return true;
}
- void move(f32 dtime, Map &map);
+ void move(f32 dtime, Map &map, f32 pos_max_d);
void applyControl(float dtime);
PlayerControl control;
private:
+ // This is used for determining the sneaking range
+ v3s16 m_last_walked_node;
};
#endif // !SERVER