cataclysmbnteam / Cataclysm-BN

Cataclysm: Bright Nights, A fork/variant of Cataclysm:DDA by CleverRaven.
https://docs.cataclysmbn.org
Other
693 stars 273 forks source link

Built walls don't receive roofs until save+load #1197

Closed Coolthulhu closed 2 years ago

Coolthulhu commented 2 years ago

Describe the bug

Built walls have no roof over them after construction, until save+load, when they receive the roofs set in their terrain type.

Steps To Reproduce

  1. Build/spawn log wall
  2. Teleport over it
  3. Fall
  4. Save+load
  5. Teleport over wall again
  6. Don't fall

Expected behavior

Fall never happens.

Screenshots

Versions and configuration

Additional context

chaosvolt commented 2 years ago

This is an old bug inherited from DDA. You can also see this with the handful of buildings that don't have an explicit roof mapgen over them.

The auto-generated roof is obtained via the roof entry in terrain JSON, example: https://github.com/cataclysmbnteam/Cataclysm-BN/blob/upload/data/json/furniture_and_terrain/terrain-floors_indoor.json#L10

So basically whatever function is set to look for roof and slap the terrain up there is only being triggered on load, not whenever the terrain first appears.