mirror of
https://github.com/luanti-org/luanti.git
synced 2025-07-27 17:28:41 +00:00
transformLiquid: small optimization and whitespace cleanup
This commit is contained in:
parent
dc4ac0b96f
commit
708f1c336e
1 changed files with 11 additions and 18 deletions
13
src/map.cpp
13
src/map.cpp
|
@ -1603,14 +1603,7 @@ void Map::transformLiquids(core::map<v3s16, MapBlock*> & modified_blocks)
|
||||||
/*
|
/*
|
||||||
Collect information about the environment
|
Collect information about the environment
|
||||||
*/
|
*/
|
||||||
v3s16 dirs[6] = {
|
const v3s16 *dirs = g_6dirs;
|
||||||
v3s16( 0, 1, 0), // top
|
|
||||||
v3s16( 0,-1, 0), // bottom
|
|
||||||
v3s16( 1, 0, 0), // right
|
|
||||||
v3s16(-1, 0, 0), // left
|
|
||||||
v3s16( 0, 0, 1), // back
|
|
||||||
v3s16( 0, 0,-1), // front
|
|
||||||
};
|
|
||||||
NodeNeighbor sources[6]; // surrounding sources
|
NodeNeighbor sources[6]; // surrounding sources
|
||||||
int num_sources = 0;
|
int num_sources = 0;
|
||||||
NodeNeighbor flows[6]; // surrounding flowing liquid nodes
|
NodeNeighbor flows[6]; // surrounding flowing liquid nodes
|
||||||
|
@ -1623,10 +1616,10 @@ void Map::transformLiquids(core::map<v3s16, MapBlock*> & modified_blocks)
|
||||||
for (u16 i = 0; i < 6; i++) {
|
for (u16 i = 0; i < 6; i++) {
|
||||||
NeighborType nt = NEIGHBOR_SAME_LEVEL;
|
NeighborType nt = NEIGHBOR_SAME_LEVEL;
|
||||||
switch (i) {
|
switch (i) {
|
||||||
case 0:
|
case 1:
|
||||||
nt = NEIGHBOR_UPPER;
|
nt = NEIGHBOR_UPPER;
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 4:
|
||||||
nt = NEIGHBOR_LOWER;
|
nt = NEIGHBOR_LOWER;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue