Cataclysm-DDA icon indicating copy to clipboard operation
Cataclysm-DDA copied to clipboard

Error when placing stepladder in open air

Open EvanBalster opened this issue 2 years ago • 5 comments

Describe the bug

activating a stepladder to place it over a ledge, such as off the roof of a one-story building, produces an error like this:

 DEBUG    : Setting furniture f_ladder at (71,67,1) where terrain is t_open_air (which is_open_air)
If this is intentional, set the ALLOW_ON_OPEN_AIR flag on the furniture

 FUNCTION : furn_set
 FILE     : D:\a\Cataclysm-DDA\Cataclysm-DDA\src\map.cpp
 LINE     : 1616
 VERSION  : 579e201

Despite this error message, the stepladder will be placed on the level below as expected.

Steps to reproduce

  1. Obtain and wield a stepladder.
  2. Navigate to the roof of a one-story building.
  3. Walk to the edge of the building.
  4. Activate the stepladder and select an open air tile at the edge of the building, one story above ground.

Expected behavior

The stepladder should be placed on the level below (and it is) but should not produce an error message.

Screenshots

No response

Versions and configuration

  • OS: Windows
    • OS Version: 10.0.19044.2251 (21H2)
  • Game Version: 579e201 [64-bit]
  • Graphics Version: Tiles
  • Game Language: System language []
  • Mods loaded: [ Dark Days Ahead [dda], Disable NPC Needs [no_npc_food], No Fungal Growth [no_fungal_growth], Bionic Professions [package_bionic_professions] ]

Additional context

No response

EvanBalster avatar Nov 11 '22 05:11 EvanBalster

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. Please do not bump or comment on this issue unless you are actively working on it. Stale issues, and stale issues that are closed are still considered.

github-actions[bot] avatar Dec 15 '22 16:12 github-actions[bot]

Can confirm, did exactly that

  • OS: Windows
    • OS Version: 10.0.19044.2364 (21H2)
  • Game Version: 7f881d8 [64-bit]
  • Graphics Version: Tiles
  • Game Language: English [en]
  • Mods loaded: [ Dark Days Ahead [dda], Disable NPC Needs [no_npc_food], Portal Storms Ignore NPCs [personal_portal_storms], No Fungal Growth [no_fungal_growth], Bionic Professions [package_bionic_professions] ]

Brambor avatar Dec 29 '22 00:12 Brambor

/Confirm

  • OS: Windows
    • OS Version: 10.0.19045.4291 (22H2)
  • Game Version: cdda-experimental-2024-05-12-1705 39e2afa [64-bit]
  • Graphics Version: Tiles
  • Game Language: System language []
  • Mods loaded: [ Dark Days Ahead [dda], Disable NPC Needs [no_npc_food], Portal Storms Ignore NPCs [personal_portal_storms], Slowdown Fungal Growth [no_fungal_growth] ]

TealcOneill avatar May 13 '24 04:05 TealcOneill

Note this issue does not occur when the ladder is placed as a climbing aid (ie, examining a ledge or moving into a ledge with a ladder in inventory). In this case a climbing aid rule is invoked and the ladder is placed on the ground below.

EvanBalster avatar May 14 '24 19:05 EvanBalster

This happens when you push f_bench and otherwise normal furniture off z-levels, as they also lack the ALLOW_ON_OPEN_AIR flag.

Do note that, seemingly the only purpose of the ALLOW_ON_OPEN_AIR flag is to avoid the error. There's the FLOATS_IN_AIR flag for when you want the furniture to float.

RedMisao avatar Sep 12 '24 05:09 RedMisao

Tangential:

When I was working on the series of PRs that introduced the climbing aid category, I was interested in tracking down the logic that governs open-air furniture. At the time I couldn't manage to find the code responsible for making furniture fall down when there is no floor immediately beneath it.

I was investigating the possibility of changes like making the "30-foot" rope or grappling hook span multiple Z-levels as you'd expect it to, and climbing one Z-level at a time on these furnishings. This could provide for interesting maneuvers like rappelling through a third-story window from the roof of a four-story building. At that time I also chatted with another contributor who wanted to implement climbable hazards (such as an elevator cable) in collapsing towers. I set aside this line of inquiry because there's currently no way for furniture to support other furniture on a higher level or support a player in an "open air" space.

EvanBalster avatar Oct 08 '24 09:10 EvanBalster

I think I saw falling furniture somewhere in do_turn... Let this be my promise of short investigation.

Brambor avatar Oct 08 '24 12:10 Brambor

https://github.com/CleverRaven/Cataclysm-DDA/blob/71a9cbb56084ac63577dff9bcaf95de604d2057d/src/map.h#L2030-L2038

There is the drop_furniture that apparently handles falling furniture.

This is how the implementation starts: https://github.com/CleverRaven/Cataclysm-DDA/blob/71a9cbb56084ac63577dff9bcaf95de604d2057d/src/map.cpp#L2971-L2975

Is this what you were looking for? Or did you find this already @EvanBalster ?

Brambor avatar Oct 09 '24 11:10 Brambor