Cataclysm-BN
Cataclysm-BN copied to clipboard
Furniture generates inside wasp paper walls
Describe the bug
I found that benches can spawn inside wasp paper walls.
Steps To Reproduce
- Find a wasp nest in the city
- See what furniture generated inside the paper walls
Screenshots
Versions and configuration
- OS: Windows
- OS Version: 10.0.19045.3448 (22H2)
- Game Version: 61c1386 [64-bit]
- Graphics Version: Tiles
- LAPI Version: 1
- Game Language: English [en_US]
- Mods loaded: [ Bright Nights [bn], Elevated bridges [elevated_bridges], Craftable Gun Pack [craftgp], Alternative Map Key [alt_map_key], Fuji's Military Profession Pack [fuji_mpp], Arcana and Magic Items [Arcana], Craftable Bullet Casings [CasingCrafting], MST Extra [MST_Extra], Tankmod: Revived [Tankmod_Revived], Essence 2200 [Essence2200], Essence 2200 Tweaks [FoxTweaks], Nonperishable Overhaul [Nonperishable_Overhaul], No Addictions [No_Addictions], Limit Fungal Growth [limit_fungal_growth], Disable NPC Needs [no_npc_food], Urban Development [Urban_Development], Cataclysm++ [Cata++], C.R.I.T. Expansion [crt_expansion], Battle Maid Redux [battle_maid] ]
Additional context
No response
Also, smashing will target the bench and not the paper wall. I don't see this as a problem because benches shouldn't spawn in walls anyway, furniture should only spawn on passable terrain and thus should be the first target.
Tables are also plagued by this bug. See this.
It appears to be map extras have no sanity checking to stop this from happening. I can use map editor to recreate this. See here that paper walls are correctly flagged as a wall, so clearly map extra generation is not stopping walls from generating onto furniture.
For this particular case, this makes actually sense : The bench was already there when the wasps came to make their nest and those pesky bugs made a wall around the bench and other existing furniture. Even with this interpretation, there is still the issue on the smashing targetting: the wall should indeed be targetted before the bench.
For this particular case, this makes actually sense : The bench was already there when the wasps came to make their nest and those pesky bugs made a wall around the bench and other existing furniture. Even with this interpretation, there is still the issue on the smashing targetting: the wall should indeed be targetted before the bench.
Then how do wasps fully destroy a brick wall. Let's keep consistency here and delete any furniture or terrain that lands on a wasp paper wall.
For this particular case, this makes actually sense : The bench was already there when the wasps came to make their nest and those pesky bugs made a wall around the bench and other existing furniture. Even with this interpretation, there is still the issue on the smashing targetting: the wall should indeed be targetted before the bench.
Then how do wasps fully destroy a brick wall. Let's keep consistency here and delete any furniture or terrain that lands on a wasp paper wall.
Indeed, the most important is consistency. Either everything is destroyed (wall, furnitures and items) or everything is preserved (Existing hard walls are kept as they are, the furniture and items are enclosed in the paper wall)
I'm still partial to the second solution for "realism" reason (sorry for the gross word), but the first one might be easier to implement and does not change significantly gameplay (I remember smashing a well-positionned paperwall to access the inside of a secure building. This was an original and interesting way to bypass the usual access limitation)
So, building wasp nests are buried in the hardcode here: https://github.com/cataclysmbnteam/Cataclysm-BN/blob/upload/src/map_extras.cpp#L258
Wilderness wasp nests are interesting, they're defined by JSON instead: https://github.com/cataclysmbnteam/Cataclysm-BN/blob/upload/data/json/mapgen/map_extras/nest_wasp.json
The JSON version still has a problem with this, but in practice the worst you'll likely see is a flower embedded in the wall. This can be fixed by either:
- JSONising urban wasp nests into an
update_mapgen_id
and remembering to use a furniture definition that tells it to placef_null
wherever it places paper walls. - Changing that weird function so that the part that goes
m.ter_set( pod + point( x, y ), t_paper );
also clears out any furniture there.
f_null
does not delete furniture already placed.
Hmm, damn. I was hoping that it would override any furniture in the specified tile.
Found this in dock.json
:
"nested": {
"a": { "chunks": [ [ "clear_furniture", 1 ] ] },
"b": { "chunks": [ [ "clear_furniture", 1 ] ] },
"c": { "chunks": [ [ "clear_furniture", 1 ] ] }
},
{
"type": "mapgen",
"method": "json",
"nested_mapgen_id": "clear_furniture",
"//": "used to be able to clear furniture when using a 'rows' placement mapping, since f_null directly is ignored",
"object": { "mapgensize": [ 1, 1 ], "set": [ { "point": "furniture", "id": "f_null", "x": 0, "y": 0 } ] }
}
Tested with mass_grave map extra and it seems to remove furniture.