1
0
mirror of https://github.com/moparisthebest/minetest synced 2024-11-17 23:05:07 -05:00

transformLiquid: small optimization and whitespace cleanup

This commit is contained in:
Giuseppe Bilotta 2011-08-16 06:00:40 +02:00
parent dc4ac0b96f
commit 708f1c336e

View File

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