diff options
author | Kahrl <kahrl@gmx.net> | 2012-01-24 00:00:26 +0100 |
---|---|---|
committer | Perttu Ahola <celeron55@gmail.com> | 2012-02-05 12:06:55 +0200 |
commit | 88cdd3a363668cfb2fd07b5381cce29738aed0bf (patch) | |
tree | 445cfa71f50e87045b44c7674dc3f3eacf9b2e15 /src/player.cpp | |
parent | e15de8b70dc13e24aefca7fdd2a17be5f150ae49 (diff) | |
download | minetest-88cdd3a363668cfb2fd07b5381cce29738aed0bf.tar.gz minetest-88cdd3a363668cfb2fd07b5381cce29738aed0bf.tar.bz2 minetest-88cdd3a363668cfb2fd07b5381cce29738aed0bf.zip |
Players stay in environment even when dead, damage flash and fall damage fixes
Don't set m_removed on dead players (dead players are indicated by hp == 0). Local
damage flash is shown whatever the cause was (even from Lua set_hp). PlayerCAO
damage flash matches duration of local damage flash. Fall damage is dealt much more consistently (this is done by disallowing jumping when speed.Y is very negative, up to now jumping could sometimes negate fall damage)
Diffstat (limited to 'src/player.cpp')
-rw-r--r-- | src/player.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/player.cpp b/src/player.cpp index 6506c43c3..068b51790 100644 --- a/src/player.cpp +++ b/src/player.cpp @@ -713,14 +713,17 @@ void LocalPlayer::applyControl(float dtime) } else if(touching_ground) { - v3f speed = getSpeed(); /* NOTE: The d value in move() affects jump height by raising the height at which the jump speed is kept at its starting value */ - speed.Y = 6.5*BS; - setSpeed(speed); + v3f speed = getSpeed(); + if(speed.Y >= -0.5*BS) + { + speed.Y = 6.5*BS; + setSpeed(speed); + } } // Use the oscillating value for getting out of water // (so that the player doesn't fly on the surface) |