Cataclysm-dda: Bullets & batteries randomizing their numbers in chargen

Created on 9 Mar 2020  路  3Comments  路  Source: CleverRaven/Cataclysm-DDA

Describe the bug

Bullets and batteries are randomizing themselves, up to the maximum defined by the profession(Reenactor has 0-1 in rifle, 1-14 in pouch, 1-15 spare).

Steps To Reproduce

  1. Pick a profession with a gun or phone.
  2. Hold down the enter key.
  3. Watch as the numbers randomize.

Expected behavior

Item numbers are granted per the profession's defined items.

Screenshots

N/A

Versions and configuration

  • OS: Windows

    • OS Version: 10.0 1903

  • Game Version: 0.D-12981-g2dbeade [64-bit]
  • Graphics Version: Tiles
  • Mods loaded: [
    Dark Days Ahead [dda],
    Aftershock [aftershock],
    Magiclysm [magiclysm],
    Alternative Map Key [alt_map_key],
    Mythical Martial Arts [MMA],
    Stats Through Kills [stats_through_kills]
    ]

Additional context

<Bug> Good First Issue Info / User Interface Mutations / Traits / Professions [C++]

All 3 comments

Looks like we need to add some flags or post-processing to functions called by profession::items() to insure all items have default charges.
https://github.com/CleverRaven/Cataclysm-DDA/blob/master/src/profession.cpp#L362
Now that I think about it, post-processing is probably good, just iterate over all the items and make sure item.charges = items.default_charges or whatever.

well i did post a thread about this before and no one gave a shit. #36279

I am currently looking into the issue, it appears there could be multiple ways of solving this game-play wise. The post processing suggested by Kevin does indeed work, but there may be other unforeseen issues! However, currently the .json for professions holds max charge information as seen below.

image

Going forward, I believe I will try to extract this information from the .json file. This extraction is already being accomplished through a professions load function. It's just a matter of insuring this data is retrievable. As it stands the main issue is that ammo in magazines and charges is not interchangeable but is being treated as such in the json file (at least it appears that way right now). I will look more into this tomorrow, and see what I can come up with.

Note:
After solving this issue professions strength will be significantly increased as most professions outlined in the .json file come with max charges and the current implantation is random. This may require professions to be looked at again for balancing.

Was this page helpful?
0 / 5 - 0 ratings