CleverRaven / Cataclysm-DDA

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

Wrong "spoils_in" values for some food in data/json/items/comestibles/carnivore.json and data/json/items/comestibles.json #70297

Closed achpile closed 3 months ago

achpile commented 9 months ago

Describe the bug

In this commit:

commit 25e35c9e1d84bd7e747ebb1611fcf90c0637dcd5
Author: BevapDin <Tho_Ki@gmx.de>
Date:   Thu Oct 18 16:51:56 2018 +0200

    Load time duration from string (containing units)

    Allows to load from a string like "2d 4h" meaning "2 days and 4 hours".

"spoils_in" was converted to string. And one particular value was converted wrong. For example:

@@ -191,7 +191,7 @@
     "weight": 40,
     "container": "bag_plastic",
     "color": "brown",
-    "spoils_in": 1008,
+    "spoils_in": "24 days",
     "charges": 3,
     "stack_size": 3,
     "parasites": 0,

1008 - it's "42 days", not 24

Items affected:

data/json/items/comestibles.json

data/json/items/comestibles/carnivore.json

There were added some more items after that commit like salted_mollusk - my guess is they "inherited" that issue

Attach save file

N/A

Steps to reproduce

git show 25e35c9e1d84bd7e747ebb1611fcf90c0637dcd5 data/json/items/comestibles.json data/json/items/comestibles/carnivore.json

Expected behavior

I expect those items get spoiled in 42 days (1008 hours)

Screenshots

No response

Versions and configuration

master branch

Additional context

Sorry, I'm not familiar with PR system here, so here's an old-fashioned patch (for some reason github does not allow to attach it as a file)

diff --git a/data/json/items/comestibles/carnivore.json b/data/json/items/comestibles/carnivore.json
index e6dfab02c6..f77c84c270 100644
--- a/data/json/items/comestibles/carnivore.json
+++ b/data/json/items/comestibles/carnivore.json
@@ -297,7 +297,7 @@
     "price": 2000,
     "price_postapoc": 3000,
     "//": "High price to reflect the rarity and value of bacon. Note that this is three pieces of it.",
-    "spoils_in": "24 days",
+    "spoils_in": "42 days",
     "fun": 5,
     "vitamins": [ [ "vitC", 0 ], [ "calcium", 3 ], [ "iron", 22 ] ],
     "flags": [ "EATEN_HOT", "SMOKED" ]
@@ -479,7 +479,7 @@
     "copy-from": "meat_mutant_tainted_cooked",
     "name": { "str_sp": "smoked tainted mutant meat" },
     "description": "Rotten mutant meat that has been heavily smoked for preservation.",
-    "spoils_in": "24 days",
+    "spoils_in": "42 days",
     "quench": -1,
     "proportional": { "price_postapoc": 1.8, "fun": 0.7 },
     "extend": { "flags": [ "EATEN_HOT", "SMOKED" ] }
@@ -794,7 +794,7 @@
     "weight": "85 g",
     "container": "bag_plastic",
     "color": "brown",
-    "spoils_in": "24 days",
+    "spoils_in": "42 days",
     "volume": "250 ml",
     "parasites": 0,
     "price": 320,
@@ -814,7 +814,7 @@
     "primary_material": "cured_meat",
     "container": "bag_plastic",
     "color": "light_gray",
-    "spoils_in": "24 days",
+    "spoils_in": "42 days",
     "parasites": 0,
     "price_postapoc": 250,
     "quench": -5,
@@ -831,7 +831,7 @@
     "primary_material": "cured_meat",
     "container": "bag_plastic",
     "color": "light_red",
-    "spoils_in": "24 days",
+    "spoils_in": "42 days",
     "parasites": 0,
     "price_postapoc": 250,
     "quench": -5,
@@ -851,7 +851,7 @@
     ],
     "description": "Tasty meat that has been heavily smoked for preservation.  It could be further smoked to dehydrate it completely.",
     "color": "brown",
-    "spoils_in": "24 days",
+    "spoils_in": "42 days",
     "price_postapoc": 200,
     "quench": -1,
     "fun": 5,
@@ -865,7 +865,7 @@
     "name": { "str_sp": "smoked fish" },
     "description": "Tasty fish that has been heavily smoked for long term preservation.  It could be further smoked to dehydrate it completely.",
     "color": "brown",
-    "spoils_in": "24 days",
+    "spoils_in": "42 days",
     "price_postapoc": 200,
     "fun": 6,
     "flags": [ "EATEN_HOT", "SMOKED", "SMOKABLE" ],
diff --git a/data/json/items/comestibles/junkfood.json b/data/json/items/comestibles/junkfood.json
index 9ad06398fc..338b68027f 100644
--- a/data/json/items/comestibles/junkfood.json
+++ b/data/json/items/comestibles/junkfood.json
@@ -879,7 +879,7 @@
     "name": { "str": "pork stick" },
     "weight": "56 g",
     "color": "brown",
-    "spoils_in": "24 days",
+    "spoils_in": "42 days",
     "container": "bag_plastic",
     "comestible_type": "FOOD",
     "symbol": "%",
diff --git a/data/json/items/comestibles/meat_dishes.json b/data/json/items/comestibles/meat_dishes.json
index e8eb75803d..2627db034f 100644
--- a/data/json/items/comestibles/meat_dishes.json
+++ b/data/json/items/comestibles/meat_dishes.json
@@ -181,7 +181,7 @@
     "name": { "str": "bacon", "str_pl": "pieces of bacon" },
     "weight": "85 g",
     "color": "pink",
-    "spoils_in": "24 days",
+    "spoils_in": "42 days",
     "container": "bag_plastic",
     "comestible_type": "FOOD",
     "symbol": "%",
@@ -1153,7 +1153,7 @@
     ],
     "copy-from": "meat_cooked",
     "color": "red",
-    "spoils_in": "24 days",
+    "spoils_in": "42 days",
     "container": "plastic_bag_vac",
     "quench": -5,
     "description": "Meat slices cured in brine.  Salty but tasty in a pinch.",
GuardianDll commented 9 months ago

/confirmed, not sure it is worth to fix this values without proper review of most comestible rot time review

achpile commented 9 months ago

/confirmed, not sure it is worth to fix this values without proper review of most comestible rot time review

It was reviewed here I guess https://github.com/CleverRaven/Cataclysm-DDA/pull/23986 Where initial value of 1008 was added (this food was unspoilable befire this PR)

GuardianDll commented 9 months ago

i mean yes, but it was made 5 years ago, we changed how we handle such stuff to a more reasonable approach, and jerky_human doesn't even exist now It's not your work, of course, just a thought

achpile commented 9 months ago

and jerky_human doesn't even exist now

Yes. Because the list is based on 25e35c9e1d84bd7e747ebb1611fcf90c0637dcd5 but my patch is based on current master branch.

List was just to show that every single "1008" value was converted in "24 hours", so it was like sed or Replace all and actually 24 is just "misspelled" 42 so it may just be a typo during values conversation :)

achpile commented 3 months ago

@Maleclypse sorry for wrong PR description format. Fixed that now.