From 17e9c0aa1a25ae978449a417b09697d060e1e364 Mon Sep 17 00:00:00 2001 From: Kevin Granade Date: Thu, 16 Jan 2014 21:29:42 -0600 Subject: [PATCH 1/2] Enhance description of water purification tablets. --- data/json/items/comestibles.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/json/items/comestibles.json b/data/json/items/comestibles.json index 00fe0ee212b89..385897872abad 100644 --- a/data/json/items/comestibles.json +++ b/data/json/items/comestibles.json @@ -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", From 34281aaa48962d3b8fcfb919d736df5eaf5bedb2 Mon Sep 17 00:00:00 2001 From: Kevin Granade Date: Thu, 16 Jan 2014 21:30:25 -0600 Subject: [PATCH 2/2] Allow iuse methods of medicines to use multiple charges at a time, mostly for water purification tablets. --- src/player.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/player.cpp b/src/player.cpp index affed8eaa7a03..ec30cfbc0e5ab 100644 --- a/src/player.cpp +++ b/src/player.cpp @@ -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") { @@ -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; } } @@ -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;