1
0
Fork 0
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:
Wuzzy 2021-10-01 14:21:24 +00:00 committed by GitHub
parent f5040707fe
commit 21113ad410
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 288 additions and 44 deletions

View file

@ -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;