1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-10-13 00:25:19 +02:00

Cache liquid alternative IDs (#8053)

This commit is contained in:
Vitaliy
2020-05-21 00:52:10 +03:00
committed by GitHub
parent 42fcfb75e8
commit 82e4137893
6 changed files with 38 additions and 16 deletions

View File

@@ -622,10 +622,10 @@ s8 MapNode::setLevel(const NodeDefManager *nodemgr, s16 level)
}
if (level >= LIQUID_LEVEL_SOURCE) {
rest = level - LIQUID_LEVEL_SOURCE;
setContent(nodemgr->getId(f.liquid_alternative_source));
setContent(f.liquid_alternative_source_id);
setParam2(0);
} else {
setContent(nodemgr->getId(f.liquid_alternative_flowing));
setContent(f.liquid_alternative_flowing_id);
setParam2((level & LIQUID_LEVEL_MASK) | (getParam2() & ~LIQUID_LEVEL_MASK));
}
} else if (f.param_type_2 == CPT2_LEVELED) {