Skip to content

Commit

Permalink
Merge pull request #77354 from RenechCDDA/cotton_patch_can_stop_bleeding
Browse files Browse the repository at this point in the history
Fix cotton patch being unusable to stop bleeding
  • Loading branch information
Maleclypse authored Oct 27, 2024
2 parents 93eee86 + c7c599a commit d515611
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 2 deletions.
7 changes: 6 additions & 1 deletion data/json/items/tool/toiletries.json
Original file line number Diff line number Diff line change
Expand Up @@ -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" ]
Expand Down
7 changes: 6 additions & 1 deletion data/mods/TEST_DATA/items.json
Original file line number Diff line number Diff line change
Expand Up @@ -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" ]
Expand Down
1 change: 1 addition & 0 deletions data/mods/innawood/items/tool_tailoring.json
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@
{
"type": "heal",
"move_cost": 200,
"bleed": 1,
"used_up_item": { "id": "fibercloth_patchwork", "quantity": 1, "flags": [ "FILTHY" ] }
},
"WASH_HARD_ITEMS"
Expand Down
5 changes: 5 additions & 0 deletions src/iuse_actor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3328,6 +3328,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" ) ) {
Expand Down

0 comments on commit d515611

Please sign in to comment.