Cataclysm-dda: Integer overflow is triggered when the time for crafting exceeds or equal to 1 year

Created on 1 Oct 2020  路  2Comments  路  Source: CleverRaven/Cataclysm-DDA

Describe the bug

Integer overflow is triggered when the time for crafting exceeds or equal one year, happens for some reason when one checks the recipe and one lacks the necessary proficiencies, the value is correct - in days and seasons - when one possesses the required proficiencies though

Steps To Reproduce

  1. Make a crafting recipe, make the crafting time equal or greater to 1 year
  2. Launch the game, find the new recipe while lacking proficiencies required in that recipe
  3. One can see that the crafting time value is subject to integer overflow
  4. Now acquire the necessary proficiencies
  5. Open the recipe again and notice that now the crafting time is displayed correctly in days and seasons

Expected behavior


Crafting recipe is displayed properly just like in the case of possessing the proficiencies - in days and seasons - even when the crafting time in the JSON code of the recipe exceeds or equal to 1 year

Screenshots


Bug

Versions and configuration



  • OS: Windows

  • OS Version: 10.0 1903

  • Game Version: 0.E-6414-g994a2c3 [64-bit]

  • Graphics Version: Tiles

  • Game Language: System language []

  • Mods loaded: [

    Dark Days Ahead [dda],

    Disable NPC Needs [no_npc_food],

    BL9 [BL9],

    Aftershock [aftershock],

    Blaze Industries [blazeindustries],

    C.R.I.T Expansion Mod [crt_expansion],

    Magiclysm [magiclysm],

    DinoMod [DinoMod],

    Crazy Cataclysm [crazy_cataclysm],

    Mythical Martial Arts [MMA],

    Stats Through Kills [stats_through_kills],

    SpeedyDex [speedydex],

    Fuji's Military Profession Pack [fuji_mpp],

    No Fungal Monsters [No_Fungi],

    Aftershock - UndeadPeople Tileset [AftershockUDP],

    Blaze Industries - UndeadPeople Tileset [BlazeIndustriesUDP],

    C.R.I.T Expansion Mod - UndeadPeople Tileset [crt_expansionUDP],

    Crazy Cataclysm - UndeadPeople Tileset [CrazyCataclysmUDP],

    DinoMod - UndeadPeople Tileset [DinoModUDP],

    Whaleys Hair Mod (UDP Tweaks) [WHALEYHAIR_UDP],

    Magiclysm - UndeadPeople Tileset [MagiclysmUDP],

    Mythical Martial Arts - UndeadPeople Tileset [MMAUDP],

    Bionic Space Expander [Bionic_Space_Expander],

    CBM Equipment [CBM_Arms],

    Mining Mod [Mining_Mod],

    More City Locations [cityside]

    ]

Additional context

The JSON file with the recipe itself message.zip

<Bug> Crafting / Construction / Recipes [C++]

Most helpful comment

I'm pretty sure a crafting time of 1 year was on nobodies mind, but dam that 141750% time increase is big. Probably should cap that or just make it impossible to craft after a certain amount.

All 2 comments

I'm pretty sure a crafting time of 1 year was on nobodies mind, but dam that 141750% time increase is big. Probably should cap that or just make it impossible to craft after a certain amount.

I would prefer if the calculations were additive instead of multiplicative. This craft time in this example would increase by 2250% instead of this insane amount.

And it would reduce the likelihood of integer overflow happening.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Cyrano7 picture Cyrano7  路  3Comments

2birdie picture 2birdie  路  3Comments

Coolthulhu picture Coolthulhu  路  3Comments

PlasmaChroma picture PlasmaChroma  路  3Comments

Coolthulhu picture Coolthulhu  路  3Comments