mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Add disable_jump and fall_damage_add_percent node groups
This commit is contained in:
parent
6a16075912
commit
b17d3e7ad7
4 changed files with 20 additions and 2 deletions
|
@ -2040,6 +2040,11 @@ void ClientEnvironment::step(float dtime)
|
|||
//f32 tolerance = BS*12; // 3 without damage
|
||||
f32 tolerance = BS*14; // 5 without damage
|
||||
f32 factor = 1;
|
||||
const ContentFeatures &f = m_gamedef->ndef()->
|
||||
get(m_map->getNodeNoEx(lplayer->getStandingNodePos()));
|
||||
// Determine fall damage multiplier
|
||||
int addp = itemgroup_get(f.groups, "fall_damage_add_percent");
|
||||
info.speed *= (1.0 + (float)addp/100.0);
|
||||
if(info.speed > tolerance)
|
||||
{
|
||||
f32 damage_f = (info.speed - tolerance)/BS*factor;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue