From c7c599a8b94382297ec7989056bc86661a43e823 Mon Sep 17 00:00:00 2001 From: RenechCDDA <84619419+RenechCDDA@users.noreply.github.com> Date: Sat, 26 Oct 2024 06:09:23 -0400 Subject: [PATCH] Fix cotton patch being unusable to stop bleeding --- data/json/items/tool/toiletries.json | 7 ++++++- data/mods/TEST_DATA/items.json | 7 ++++++- data/mods/innawood/items/tool_tailoring.json | 1 + src/iuse_actor.cpp | 5 +++++ 4 files changed, 18 insertions(+), 2 deletions(-) diff --git a/data/json/items/tool/toiletries.json b/data/json/items/tool/toiletries.json index 7b4bd3a8b7992..3f5b75b740b53 100644 --- a/data/json/items/tool/toiletries.json +++ b/data/json/items/tool/toiletries.json @@ -140,7 +140,12 @@ "qualities": [ [ "SIEVE", 1 ], [ "STRAIN", 2 ] ], "color": "white", "use_action": [ - { "type": "heal", "move_cost": 200, "used_up_item": { "id": "cotton_patchwork", "quantity": 1, "flags": [ "FILTHY" ] } }, + { + "type": "heal", + "move_cost": 200, + "bleed": 1, + "used_up_item": { "id": "cotton_patchwork", "quantity": 1, "flags": [ "FILTHY" ] } + }, "WASH_HARD_ITEMS" ], "flags": [ "NO_SALVAGE" ] diff --git a/data/mods/TEST_DATA/items.json b/data/mods/TEST_DATA/items.json index 5baca36031c45..ab8ecdc5aa48a 100644 --- a/data/mods/TEST_DATA/items.json +++ b/data/mods/TEST_DATA/items.json @@ -165,7 +165,12 @@ "symbol": ",", "color": "white", "use_action": [ - { "type": "heal", "move_cost": 200, "used_up_item": { "id": "cotton_patchwork", "quantity": 1, "flags": [ "FILTHY" ] } }, + { + "type": "heal", + "move_cost": 200, + "bleed": 1, + "used_up_item": { "id": "cotton_patchwork", "quantity": 1, "flags": [ "FILTHY" ] } + }, "WASH_HARD_ITEMS" ], "flags": [ "NO_SALVAGE" ] diff --git a/data/mods/innawood/items/tool_tailoring.json b/data/mods/innawood/items/tool_tailoring.json index 429a6527e43bc..1ae6cb559b342 100644 --- a/data/mods/innawood/items/tool_tailoring.json +++ b/data/mods/innawood/items/tool_tailoring.json @@ -139,6 +139,7 @@ { "type": "heal", "move_cost": 200, + "bleed": 1, "used_up_item": { "id": "fibercloth_patchwork", "quantity": 1, "flags": [ "FILTHY" ] } }, "WASH_HARD_ITEMS" diff --git a/src/iuse_actor.cpp b/src/iuse_actor.cpp index 9e3bfd70e568a..92c8845221219 100644 --- a/src/iuse_actor.cpp +++ b/src/iuse_actor.cpp @@ -3306,6 +3306,11 @@ void heal_actor::load( const JsonObject &obj, const std::string & ) } } + if( !bandages_power && !disinfectant_power && !bleed && !bite && !infect && + !obj.has_array( "effects" ) ) { + obj.throw_error( _( "Heal actor is missing any valid healing effect" ) ); + } + if( obj.has_string( "used_up_item" ) ) { obj.read( "used_up_item", used_up_item_id, true ); } else if( obj.has_object( "used_up_item" ) ) {