Jump to content

[41.78.16] Crafted Food can have nan Age


Recommended Posts

Posted (edited)

• Version 47.78.16

• Singleplayer and Multiplayer

• Host and Dedicated

• Sapph's cooking

• New and old saves

• Reproduction steps:

  1. Modify a recipe with a result item of Type=Food to not have any items of Type=Food in the ingredients list.
    1. Ex: Make Bread Dough. Remove salt from recipe in \SteamLibrary\steamapps\common\ProjectZomboid\media\scripts\recipes.txtrecipes.txt
  2. Load game in debug
  3. Craft food Bread Dough
  4. Open the produced food's edit menu.
    1. Item will have nan as age, thereby making it last forever.



Cause of the issue seems to be in the RecipeManager.PerformMakeItem function where is a divide by 0 when no items of Type=Food are in the item list of ingredients. The nan eventually gets propagated to the created item when setAge is called.


This reproduction steps do not involve Sapph's cooking. However, the mod just makes the issue apparent with some of the added recipes.


Edited by piromasta
finished a line
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...