mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-06 17:41:04 +00:00
Physics overrides: Move values to a common struct (#12591)
Co-authored-by: sfan5 <sfan5@live.de>
This commit is contained in:
parent
df1d215f48
commit
c8ee755c05
11 changed files with 81 additions and 71 deletions
13
src/player.h
13
src/player.h
|
@ -96,6 +96,18 @@ struct PlayerControl
|
|||
float movement_direction = 0.0f;
|
||||
};
|
||||
|
||||
struct PlayerPhysicsOverride
|
||||
{
|
||||
float speed = 1.f;
|
||||
float jump = 1.f;
|
||||
float gravity = 1.f;
|
||||
|
||||
bool sneak = true;
|
||||
bool sneak_glitch = false;
|
||||
// "Temporary" option for old move code
|
||||
bool new_move = true;
|
||||
};
|
||||
|
||||
struct PlayerSettings
|
||||
{
|
||||
bool free_move = false;
|
||||
|
@ -182,6 +194,7 @@ public:
|
|||
|
||||
PlayerControl control;
|
||||
const PlayerControl& getPlayerControl() { return control; }
|
||||
PlayerPhysicsOverride physics_override;
|
||||
PlayerSettings &getPlayerSettings() { return m_player_settings; }
|
||||
static void settingsChangedCallback(const std::string &name, void *data);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue