Skip to content

Commit

Permalink
Merge pull request #17900 from woutershep/fridge
Browse files Browse the repository at this point in the history
Fix minifridge not cooling items properly.
  • Loading branch information
Coolthulhu committed Aug 5, 2016
2 parents af6830f + 7d42bd9 commit cd48bca
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4642,8 +4642,10 @@ item map::water_from( const tripoint &p )
// date to current time, and also check contents.
static void apply_in_fridge(item &it)
{
if (it.is_food() && it.fridge == 0) {
it.fridge = (int) calendar::turn;
if (it.is_food()) {
if (it.fridge == 0) {
it.fridge = (int) calendar::turn;
}
// cool down of the HOT flag, is unsigned, don't go below 1
if ((it.has_flag("HOT")) && (it.item_counter > 10)) {
it.item_counter -= 10;
Expand All @@ -4653,7 +4655,7 @@ static void apply_in_fridge(item &it)
it.item_tags.insert("COLD");
it.active = true;
}
if ((it.has_flag("COLD")) && (it.item_counter <= 590) && it.fridge > 0) {
if ((it.has_flag("COLD")) && (it.item_counter <= 590)) {
it.item_counter += 10;
}
}
Expand Down

0 comments on commit cd48bca

Please sign in to comment.