Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
achpile opened this issue Dec 19, 2023 · 5 comments · Fixed by #74898
Labels
Good First Issue This is a good first issue for a new contributor [JSON] Changes (can be) made in JSON (S2 - Confirmed) Bug that's been confirmed to exist

Comments

@achpile
Copy link
Contributor

achpile commented Dec 19, 2023

Describe the bug

In this commit:

commit 25e35c9e1d84bd7e747ebb1611fcf90c0637dcd5
Author: BevapDin <[email protected]>
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

  • sausage
  • porkstick
  • bacon

data/json/items/comestibles/carnivore.json

  • jerky
  • salted_fish
  • jerky_human
  • meat_smoked
  • fish_smoked
  • human_smoked

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.",
@achpile achpile added the (S1 - Need confirmation) Report waiting on confirmation of reproducibility label Dec 19, 2023
@GuardianDll
Copy link
Member

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

@github-actions github-actions bot added (S2 - Confirmed) Bug that's been confirmed to exist and removed (S1 - Need confirmation) Report waiting on confirmation of reproducibility labels Dec 19, 2023
@achpile
Copy link
Contributor Author

achpile commented Dec 19, 2023

/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 #23986
Where initial value of 1008 was added (this food was unspoilable befire this PR)

@GuardianDll
Copy link
Member

GuardianDll commented Dec 19, 2023

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
Copy link
Contributor Author

achpile commented Dec 19, 2023

and jerky_human doesn't even exist now

Yes. Because the list is based on 25e35c9 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 :)

@Maleclypse Maleclypse added Good First Issue This is a good first issue for a new contributor [JSON] Changes (can be) made in JSON labels Dec 31, 2023
@achpile
Copy link
Contributor Author

achpile commented Jul 4, 2024

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

Maleclypse added a commit that referenced this issue Jul 7, 2024
Fixed wrong "spoils_in" value for some food (fixes #70297)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Good First Issue This is a good first issue for a new contributor [JSON] Changes (can be) made in JSON (S2 - Confirmed) Bug that's been confirmed to exist
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants