Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.
Sign upAll cooked food turns rotten immediately #4805
Comments
This comment has been minimized.
This comment has been minimized.
|
This could be a pretty cool feature if it were from a catastrophic cooking skill check failure. |
This comment has been minimized.
This comment has been minimized.
|
I think you'd just end up with a lump of charcoal in that case. |
This comment has been minimized.
This comment has been minimized.
|
Yeah, that makes more sense. Or another flag (Disgusting) . Perhaps it is burnt, maybe it is too salty, or too poorly spiced. The food itself IS edible and won't make you sick, but it tastes just AWFUL and is bad for your morale than usual (or worse if it was already bad for morale). |
This comment has been minimized.
This comment has been minimized.
|
That is probably just the normal revivification process as the goo revives the dead meat. Lol. |
This comment has been minimized.
This comment has been minimized.
|
As I mentioned, and others said in the forum thread, it appears to treat hot food as being rotten. |
This comment has been minimized.
This comment has been minimized.
|
In game::complete_craft() food items are given a "fuzzy birthday", which sets the newly-created item's Meanwhile, item::rotten() works roughly like this: int expiry;
it_comest* food = dynamic_cast<it_comest*>(type);
if (food->spoils != 0) {
expiry = (int)g->turn - bday;
return (expiry > food->spoils * 600);
}With future struct it_comest : public itype
{
// ...
unsigned int spoils; // How long it takes to spoil (hours / 600 turns)
// ...
}This causes a signed-unsigned comparison with item::rotten(), which "promotes" The quick fix to this bug is this: return (expiry > (int)food->spoils * 600);The better fix would be to remove |
This comment has been minimized.
This comment has been minimized.
|
I'm not entirely sure that 'spoils' needs to be an unsigned int, either, given that a signed int would hold enough hours for 89 million days, plus change. Awesome analysis, and good bug-hunting, @tung. |
Rivet-the-Zombie
referenced this issue
Dec 4, 2013
Closed
0.9-1643-g42428d6 So-called 'fresh' cooked food is still rotten. #4864
This comment has been minimized.
This comment has been minimized.
|
This has been fixed. |
ianestrachan commentedDec 1, 2013
Reported and confirmed many times in: http://smf.cataclysmdda.com/index.php?topic=4584.0
It seems to be some collision between the (hot) and (rotten) tags.