From c613faae80429bee89371cae50e4e8d8c5b68a79 Mon Sep 17 00:00:00 2001 From: CobaltXII Date: Tue, 1 Jan 2019 21:35:45 -0500 Subject: [PATCH] Water now floods small holes --- src/main.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index b3d82b3..4c03f86 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -687,10 +687,24 @@ int main(int argc, char** argv) } else { - if (the_world->get_id(px, py, pz) != id_water) + if (the_world->get_id_safe(px, py, pz) != id_water) { the_accessor->set_id_safe(px, py, pz, id_air); + if + ( + the_world->get_id_safe(px + 1, py, pz) == id_water || + the_world->get_id_safe(px - 1, py, pz) == id_water || + + the_world->get_id_safe(px, py, pz + 1) == id_water || + the_world->get_id_safe(px, py, pz - 1) == id_water || + + the_world->get_id_safe(px, py - 1, pz) == id_water + ) + { + the_accessor->set_id_safe(px, py, pz, id_water); + } + block_timer = 10; break;