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