From ba3925201819b960cf481a7a7d5b0df4a4553ccb Mon Sep 17 00:00:00 2001 From: CobaltXII Date: Sat, 5 Jan 2019 10:22:42 -0500 Subject: [PATCH] Fire cannot be placed in certain places --- src/main.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/main.cpp b/src/main.cpp index 80a6a68..2064c10 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -856,6 +856,21 @@ int main(int argc, char** argv) } } } + else if (place_id == id_fire) + { + // Fire can only be placed on top of solid + // blocks; that is, blocks that are not + // slabs, crops, crosses or fire. + + block_id fire_below = the_world->get_id_safe(px, py + 1, pz); + + if (!is_slab(fire_below) && !is_crop(fire_below) && !is_cross(fire_below) && !is_fire(fire_below)) + { + the_accessor->set_id_safe(px, py, pz, place_id); + + block_timer = 10; + } + } else { the_accessor->set_id_safe(px, py, pz, place_id);