Skip to content

Commit

Permalink
Merge pull request #5586 from kevingranade/water-purification-tablet-…
Browse files Browse the repository at this point in the history
…rework

Water purification tablet rework
  • Loading branch information
Rivet-the-Zombie committed Jan 17, 2014
2 parents ad772de + 34281aa commit c3f7a0f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion data/json/items/comestibles.json
Original file line number Diff line number Diff line change
Expand Up @@ -11497,7 +11497,7 @@
"heal" : 0,
"addiction_potential" : 0,
"nutrition" : 0,
"description" : "Intended for the clarification and disinfection of unsafe drinking water, these halazone-based purification tablets remove dangerous contaminants using powerful chemicals.",
"description" : "Intended for the clarification and disinfection of unsafe drinking water, these halazone-based purification tablets remove dangerous contaminants using powerful chemicals. The label says to use one tablet per unit of water.",
"price" : 1000,
"material" : "null",
"tool" : "null",
Expand Down
7 changes: 4 additions & 3 deletions src/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6822,6 +6822,7 @@ bool player::consume(int pos)
return false;
}

int amount_used = 1;
bool was_consumed = false;
if (comest != NULL) {
if (comest->comesttype == "FOOD" || comest->comesttype == "DRINK") {
Expand All @@ -6846,8 +6847,8 @@ bool player::consume(int pos)
}
if (comest->use != &iuse::none) {
//Check special use
int was_used = comest->use.call(this, to_eat, false);
if( was_used == 0 ) {
amount_used = comest->use.call(this, to_eat, false);
if( amount_used == 0 ) {
return false;
}
}
Expand Down Expand Up @@ -6897,7 +6898,7 @@ bool player::consume(int pos)
}

// Actions after consume
to_eat->charges--;
to_eat->charges -= amount_used;
if (to_eat->charges <= 0) {
if (which == -1) {
weapon = ret_null;
Expand Down

0 comments on commit c3f7a0f

Please sign in to comment.