CleverRaven / Cataclysm-DDA

Cataclysm - Dark Days Ahead. A turn-based survival game set in a post-apocalyptic world.
http://cataclysmdda.org
Other
10.61k stars 4.17k forks source link

SEGFAULT when applying a bottom mount to favorited firearms #56827

Closed DalenTalas closed 2 years ago

DalenTalas commented 2 years ago

Describe the bug

When all firearms in inventory are marked as favorite (or, in other words, when there is no un-favorited gun in the inventory), (a)pplying a bottom mount causes a segmentation fault.

Steps to reproduce

  1. Spawn two guns with bottom mount slots and a bottom mount mod. No need to have the sufficient skills to mount the mod. (EDIT: on second thought, the guns do not necessarily need to have the mod slot, just be present in the inventory.)
  2. (A)pply one of the bottom mounts. Notice behavior as usual. No need to actually attach the mod.
  3. Mark one of the guns as a favorite. Once again, (a)pply one of the bottom mounts to one of the guns. Notice behavior as usual.
  4. Mark both guns as favorites. Once again, (a)pply one of the bottom mounts to one of the guns. Notice a crash to desktop with a segmentation fault.

Expected behavior

Game not crashing.

Screenshots

No response

Versions and configuration

Additional context

The issue does not seem to be present with bow mods, so this is not something that affects all weapon mods - likely just the bottom mount, or other "mount" mods. Will test later if necessary.

Crash and debug logs added: config.zip

DalenTalas commented 2 years ago

Issue still extant in f37635a. Updated description with relevant info.