mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Split liquid_viscosity to liquid_viscosity and move_resistance (#10810)
This commit is contained in:
parent
f5040707fe
commit
21113ad410
15 changed files with 288 additions and 44 deletions
|
@ -227,8 +227,9 @@ void LocalPlayer::move(f32 dtime, Environment *env, f32 pos_max_d,
|
|||
pp = floatToInt(position + v3f(0.0f, BS * 0.1f, 0.0f), BS);
|
||||
node = map->getNode(pp, &is_valid_position);
|
||||
if (is_valid_position) {
|
||||
in_liquid = nodemgr->get(node.getContent()).isLiquid();
|
||||
liquid_viscosity = nodemgr->get(node.getContent()).liquid_viscosity;
|
||||
const ContentFeatures &cf = nodemgr->get(node.getContent());
|
||||
in_liquid = cf.liquid_move_physics;
|
||||
move_resistance = cf.move_resistance;
|
||||
} else {
|
||||
in_liquid = false;
|
||||
}
|
||||
|
@ -238,8 +239,9 @@ void LocalPlayer::move(f32 dtime, Environment *env, f32 pos_max_d,
|
|||
pp = floatToInt(position + v3f(0.0f, BS * 0.5f, 0.0f), BS);
|
||||
node = map->getNode(pp, &is_valid_position);
|
||||
if (is_valid_position) {
|
||||
in_liquid = nodemgr->get(node.getContent()).isLiquid();
|
||||
liquid_viscosity = nodemgr->get(node.getContent()).liquid_viscosity;
|
||||
const ContentFeatures &cf = nodemgr->get(node.getContent());
|
||||
in_liquid = cf.liquid_move_physics;
|
||||
move_resistance = cf.move_resistance;
|
||||
} else {
|
||||
in_liquid = false;
|
||||
}
|
||||
|
@ -252,7 +254,7 @@ void LocalPlayer::move(f32 dtime, Environment *env, f32 pos_max_d,
|
|||
pp = floatToInt(position + v3f(0.0f), BS);
|
||||
node = map->getNode(pp, &is_valid_position);
|
||||
if (is_valid_position) {
|
||||
in_liquid_stable = nodemgr->get(node.getContent()).isLiquid();
|
||||
in_liquid_stable = nodemgr->get(node.getContent()).liquid_move_physics;
|
||||
} else {
|
||||
in_liquid_stable = false;
|
||||
}
|
||||
|
@ -800,8 +802,9 @@ void LocalPlayer::old_move(f32 dtime, Environment *env, f32 pos_max_d,
|
|||
pp = floatToInt(position + v3f(0.0f, BS * 0.1f, 0.0f), BS);
|
||||
node = map->getNode(pp, &is_valid_position);
|
||||
if (is_valid_position) {
|
||||
in_liquid = nodemgr->get(node.getContent()).isLiquid();
|
||||
liquid_viscosity = nodemgr->get(node.getContent()).liquid_viscosity;
|
||||
const ContentFeatures &cf = nodemgr->get(node.getContent());
|
||||
in_liquid = cf.liquid_move_physics;
|
||||
move_resistance = cf.move_resistance;
|
||||
} else {
|
||||
in_liquid = false;
|
||||
}
|
||||
|
@ -810,8 +813,9 @@ void LocalPlayer::old_move(f32 dtime, Environment *env, f32 pos_max_d,
|
|||
pp = floatToInt(position + v3f(0.0f, BS * 0.5f, 0.0f), BS);
|
||||
node = map->getNode(pp, &is_valid_position);
|
||||
if (is_valid_position) {
|
||||
in_liquid = nodemgr->get(node.getContent()).isLiquid();
|
||||
liquid_viscosity = nodemgr->get(node.getContent()).liquid_viscosity;
|
||||
const ContentFeatures &cf = nodemgr->get(node.getContent());
|
||||
in_liquid = cf.liquid_move_physics;
|
||||
move_resistance = cf.move_resistance;
|
||||
} else {
|
||||
in_liquid = false;
|
||||
}
|
||||
|
@ -823,7 +827,7 @@ void LocalPlayer::old_move(f32 dtime, Environment *env, f32 pos_max_d,
|
|||
pp = floatToInt(position + v3f(0.0f), BS);
|
||||
node = map->getNode(pp, &is_valid_position);
|
||||
if (is_valid_position)
|
||||
in_liquid_stable = nodemgr->get(node.getContent()).isLiquid();
|
||||
in_liquid_stable = nodemgr->get(node.getContent()).liquid_move_physics;
|
||||
else
|
||||
in_liquid_stable = false;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue