forked from Mirrorlandia_minetest/minetest
Disable autoforward if player is dead
This commit is contained in:
parent
ded5da7800
commit
3c395d908f
@ -1541,6 +1541,9 @@ void GenericCAO::processMessage(const std::string &data)
|
||||
|
||||
m_hp = result_hp;
|
||||
|
||||
if (m_is_local_player)
|
||||
m_env->getLocalPlayer()->hp = m_hp;
|
||||
|
||||
if (damage > 0)
|
||||
{
|
||||
if (m_hp <= 0)
|
||||
|
@ -2466,7 +2466,7 @@ void Game::updatePlayerControl(const CameraOrientation &cam)
|
||||
}
|
||||
|
||||
// autoforward if set: simulate "up" key
|
||||
if (player->getPlayerSettings().continuous_forward) {
|
||||
if (player->getPlayerSettings().continuous_forward && !player->isDead()) {
|
||||
control.up = true;
|
||||
keypress_bits |= 1U << 0;
|
||||
}
|
||||
|
@ -489,7 +489,7 @@ void LocalPlayer::applyControl(float dtime, Environment *env)
|
||||
PlayerSettings &player_settings = getPlayerSettings();
|
||||
|
||||
// All vectors are relative to the player's yaw,
|
||||
// (and pitch if pitch fly mode enabled),
|
||||
// (and pitch if pitch move mode enabled),
|
||||
// and will be rotated at the end
|
||||
v3f speedH = v3f(0,0,0); // Horizontal (X, Z)
|
||||
v3f speedV = v3f(0,0,0); // Vertical (Y)
|
||||
|
@ -100,7 +100,7 @@ public:
|
||||
bool makes_footstep_sound = true;
|
||||
|
||||
int last_animation = NO_ANIM;
|
||||
float last_animation_speed;
|
||||
float last_animation_speed = 0.0f;
|
||||
|
||||
std::string hotbar_image = "";
|
||||
std::string hotbar_selected_image = "";
|
||||
@ -149,6 +149,8 @@ public:
|
||||
|
||||
bool getAutojump() const { return m_autojump; }
|
||||
|
||||
bool isDead() const { return hp <= 0; }
|
||||
|
||||
inline void addVelocity(const v3f &vel)
|
||||
{
|
||||
added_velocity += vel;
|
||||
|
Loading…
Reference in New Issue
Block a user