From 3b6c5183ac23eaec5210c9eefa2db1b3e047cdb2 Mon Sep 17 00:00:00 2001 From: Procyonae <45432782+Procyonae@users.noreply.github.com> Date: Sun, 22 Dec 2024 15:42:23 +0000 Subject: [PATCH] Reinstate Chesterton's fence now I get what it's doing --- data/json/mapgen/map_extras/laststand.json | 1 - src/mapgen.cpp | 6 ++++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/data/json/mapgen/map_extras/laststand.json b/data/json/mapgen/map_extras/laststand.json index 1d93a876b03a3..b31f9ff584701 100644 --- a/data/json/mapgen/map_extras/laststand.json +++ b/data/json/mapgen/map_extras/laststand.json @@ -68,7 +68,6 @@ [ "f_null", 150 ] ] }, - "remove_vehicles": [ { "x": [ 0, 23 ], "y": [ 0, 23 ] } ], "place_monster": [ { "group": "GROUP_LAST_STAND", "x": [ 6, 17 ], "y": [ 6, 16 ], "chance": 100, "repeat": [ 10, 15 ] } ], "place_loot": [ { "group": "trash", "x": [ 6, 17 ], "y": [ 6, 16 ], "repeat": [ 5, 10 ] } ], "flags": [ "ERASE_ALL_BEFORE_PLACING_TERRAIN" ] diff --git a/src/mapgen.cpp b/src/mapgen.cpp index fd90079fa2197..a27dbfb4e8d0a 100644 --- a/src/mapgen.cpp +++ b/src/mapgen.cpp @@ -5304,6 +5304,12 @@ static ret_val apply_mapgen_in_phases( const jmapgen_objects &objects, const tripoint_rel_ms &offset, const std::string &context, bool verify = false ) { + const ret_val has_vehicle_collision = objects.has_vehicle_collision( md, offset ); + if( verify && !has_vehicle_collision.success() ) { + + return has_vehicle_collision; + } + // We must apply all the mapgen in phases, but the mapgen is split between // setmap_points and objects. So we have to make an outer loop over // phases, and apply each type restricted to each phase.