diff options
author | proller <proller@github.com> | 2013-06-30 01:29:21 +0400 |
---|---|---|
committer | proller <proller@github.com> | 2013-06-30 01:29:21 +0400 |
commit | 848c3fe51a842950b14547491c74aaf580dc83ec (patch) | |
tree | aa4995a07d3db8d08f0e08453b88ff0af50b2fae /src/content_abm.cpp | |
parent | 21a4adcd27de83a814f2ff296d867b9876dc35c1 (diff) | |
download | minetest-848c3fe51a842950b14547491c74aaf580dc83ec.tar.gz minetest-848c3fe51a842950b14547491c74aaf580dc83ec.tar.bz2 minetest-848c3fe51a842950b14547491c74aaf580dc83ec.zip |
Optimize liquid queue on generate map for liquid_finite
Diffstat (limited to 'src/content_abm.cpp')
-rw-r--r-- | src/content_abm.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/content_abm.cpp b/src/content_abm.cpp index 3704fe83d..6adcbf708 100644 --- a/src/content_abm.cpp +++ b/src/content_abm.cpp @@ -228,9 +228,12 @@ public: ServerMap *map = &env->getServerMap(); if (map->transforming_liquid_size() > 500) return; - //todo: look around except top - MapNode n_below = map->getNodeNoEx(p - v3s16(0, 1, 0)); - if (n_below.getContent() != CONTENT_AIR) + if ( map->getNodeNoEx(p - v3s16(0, 1, 0 )).getContent() != CONTENT_AIR // below + && map->getNodeNoEx(p - v3s16(1, 0, 0 )).getContent() != CONTENT_AIR // right + && map->getNodeNoEx(p - v3s16(-1, 0, 0 )).getContent() != CONTENT_AIR // left + && map->getNodeNoEx(p - v3s16(0, 0, 1 )).getContent() != CONTENT_AIR // back + && map->getNodeNoEx(p - v3s16(0, 0, -1)).getContent() != CONTENT_AIR // front + ) return; map->transforming_liquid_add(p); } |