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

Missing migration for mossberg_500_security?

Open hexagonrecursion opened this issue 1 year ago • 2 comments
trafficstars

Describe the bug

#72398 by @DoctorBoomstick removed mossberg_500_security variant of mossberg_500, but did not add any migrations. Loading save files from before the change produces an error:

 DEBUG    : item 'mossberg_500' has no variant 'mossberg_500_security'!

 FUNCTION : void item::set_itype_variant(const string&)
 FILE     : src/item.cpp
 LINE     : 9336
 VERSION  : cdda-experimental-2024-03-24-0121 cf9267f

Note: I do not know whether it is possible to migrate a variant of an item

Attach save file

bug.zip

Steps to reproduce

  1. Load the attached save
  2. Get error

Expected behavior

No error

Screenshots

No response

Versions and configuration

  • OS: Linux
    • OS Version:
  • Game Version: cdda-experimental-2024-03-24-0121 cf9267f [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], Translate Complex Dialogue [translate_dialogue] ]

Additional context

No response

hexagonrecursion avatar Mar 24 '24 19:03 hexagonrecursion

I was informed that there is, at present, no way to migrate variants and that the game would just pick a random variant itself if the one generated before the update doesn’t exist any more. As far as I know, without testing, the gun should still exist and be converted to the 500 Field. If you could confirm or deny this, it would be of assistance.

DoctorBoomstick avatar Mar 24 '24 19:03 DoctorBoomstick

  1. The game does appear to convert the shotgun to 500 Field
  2. The documentation for item migration describes a from_variant field. If things work as documented, it should be possible to write a migration for a removed variant. I'll submit a pull request if this works.

hexagonrecursion avatar Mar 25 '24 04:03 hexagonrecursion