mirror of
https://github.com/minetest/minetest.git
synced 2024-11-27 10:03:45 +01:00
transformLiquid: small optimization and whitespace cleanup
This commit is contained in:
parent
dc4ac0b96f
commit
708f1c336e
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
|
||||
*/
|
||||
v3s16 dirs[6] = {
|
||||
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
|
||||
};
|
||||
const v3s16 *dirs = g_6dirs;
|
||||
NodeNeighbor sources[6]; // surrounding sources
|
||||
int num_sources = 0;
|
||||
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++) {
|
||||
NeighborType nt = NEIGHBOR_SAME_LEVEL;
|
||||
switch (i) {
|
||||
case 0:
|
||||
case 1:
|
||||
nt = NEIGHBOR_UPPER;
|
||||
break;
|
||||
case 1:
|
||||
case 4:
|
||||
nt = NEIGHBOR_LOWER;
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user