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

Wierd suffix in message: `What to do with the extension cord?solar panel`

Open Brambor opened this issue 1 year ago • 3 comments

Describe the bug

image

Attach save file

がめ-trimmed.tar.gz - said to be corrupted, use this one https://github.com/CleverRaven/Cataclysm-DDA/issues/73859#issuecomment-2130792571

Steps to reproduce

  1. Load save.
  2. Open AIM /.
  3. Activate extension cord (x/10 cable).
  4. Observe weird message.

Expected behavior

Drop the solar panel in the suffix, probably.

Screenshots

No response

Versions and configuration

  • OS: Windows
    • OS Version: 10.0.19045.4291 (22H2)
  • Game Version: 0.G-9614-gf522d7df2d-dirty [64-bit] master was 39e2afa80d
  • 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], Slowdown Fungal Growth [no_fungal_growth] ]

Additional context

No response

Brambor avatar May 16 '24 17:05 Brambor

https://github.com/CleverRaven/Cataclysm-DDA/blob/a7fd8587413e4e4552b01e4b7574ecf8f498075d/src/iuse_actor.cpp#L4530-L4536

t_veh should be a nullptr, but somehow its referencing a solar panel

Edit Ignore the above this is incorrect

Bobtron avatar May 18 '24 03:05 Bobtron

I did connect it to solar panel on the roof (z=1) and then walked away (in the z=0), until the cable snapped.

Those should be the reproduction steps.

Brambor avatar May 18 '24 10:05 Brambor

/Confirm This happens with any appliance it's connected to. The z level doesn't affect this at all. Also, it uses the name of the appliance if applicable which I'm not sure matters but it's something. I couldn't unzip the included save, 7zip says the archive is corrupted. I've included a new one

  • OS: Windows
    • OS Version: 10.0.19045.4412 (22H2)
  • Game Version: cdda-experimental-2024-05-25-0134 22d851b [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] ] Tira-trimmed.tar.gz

TealcOneill avatar May 25 '24 05:05 TealcOneill

Thanks for the clarification/confirmation

The code snippet above is incorrect, I used a debugger to trace through where its getting the vehicle name added, and this is where its happening:

https://github.com/CleverRaven/Cataclysm-DDA/blob/f7cce92956ee3d7fb96f233725adbe323d222c77/src/iuse_actor.cpp#L4596-L4624

The assumption of the else statement is false This is a cable item with at least one connection already:, where there should be no connection as the link over-extended and snapped off.

Also in the reset link, we don't remove the t_veh pointer, and we can't use link_.reset(); as we need to keep the state that the link needs to be respooled.

https://github.com/CleverRaven/Cataclysm-DDA/blob/f7cce92956ee3d7fb96f233725adbe323d222c77/src/item.cpp#L13930-L13940

Thinking we can fix this by setting link().t_veh = nullptr after line 13932, but open to suggestions

Bobtron avatar May 29 '24 17:05 Bobtron