transformLiquid: small optimization and whitespace cleanup

master
Giuseppe Bilotta 2011-08-16 06:00:40 +02:00
parent dc4ac0b96f
commit 708f1c336e
1 changed files with 11 additions and 18 deletions

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