Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
Removes obsoleted iuse actors, updates npctalk to make use of new iuse return format. Update a test I missed previously. Updates JSONs
  • Loading branch information
KheirFerrum committed Dec 4, 2024
1 parent 669b15e commit 23c6368
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 9 deletions.
2 changes: 1 addition & 1 deletion data/json/items/armor/power_armor.json
Original file line number Diff line number Diff line change
Expand Up @@ -686,7 +686,7 @@
"storage": "15 L",
"warmth": 10,
"material_thickness": 8,
"max_charges": "500 kJ",
"max_power": "500 kJ",
"relic_data": {
"passive_effects": [
{
Expand Down
3 changes: 0 additions & 3 deletions src/item_factory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -956,9 +956,7 @@ void Item_factory::init()
add_iuse( "EXTINGUISHER", &iuse::extinguisher );
add_iuse( "EYEDROPS", &iuse::eyedrops );
add_iuse( "FILL_PIT", &iuse::fill_pit );
add_iuse( "FIRECRACKER", &iuse::firecracker );
add_iuse( "FIRECRACKER_ACT", &iuse::firecracker_act );
add_iuse( "FIRECRACKER_PACK", &iuse::firecracker_pack );
add_iuse( "FIRECRACKER_PACK_ACT", &iuse::firecracker_pack_act );
add_iuse( "FISH_ROD", &iuse::fishing_rod );
add_iuse( "FISH_TRAP", &iuse::fish_trap );
Expand Down Expand Up @@ -1051,7 +1049,6 @@ void Item_factory::init()
add_iuse( "STIMPACK", &iuse::stimpack );
add_iuse( "STRONG_ANTIBIOTIC", &iuse::strong_antibiotic );
add_iuse( "TAZER", &iuse::tazer );
add_iuse( "TAZER2", &iuse::tazer2 );
add_iuse( "TELEPORT", &iuse::teleport );
add_iuse( "THORAZINE", &iuse::thorazine );
add_iuse( "THROWABLE_EXTINGUISHER_ACT", &iuse::throwable_extinguisher_act );
Expand Down
2 changes: 1 addition & 1 deletion src/npctalk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3367,7 +3367,7 @@ static consumption_result try_consume( npc &p, item &it, std::string &reason )
reason = _( "Thanks, I feel better already." );
}
if( to_eat.type->has_use() ) {
amount_used = to_eat.type->invoke( p, to_eat, p.pos() );
amount_used = to_eat.type->invoke( p, to_eat, p.pos() ).first;
if( amount_used <= 0 ) {
reason = _( "It doesn't look like a good idea to consume this…" );
return REFUSED;
Expand Down
6 changes: 2 additions & 4 deletions tests/iuse_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -564,8 +564,7 @@ TEST_CASE( "inhaler", "[iuse][inhaler]" )
TEST_CASE( "panacea", "[iuse][panacea]" )
{
avatar dummy;
detached_ptr<item> det = item::spawn( "panacea", calendar::start_of_cataclysm,
item::default_charges_tag{} );
detached_ptr<item> det = item::spawn( "panacea", calendar::start_of_cataclysm );
item &panacea = *det;
dummy.i_add( std::move( det ) );

Expand All @@ -580,8 +579,7 @@ TEST_CASE( "panacea", "[iuse][panacea]" )
TEST_CASE( "xanax", "[iuse][xanax]" )
{
avatar dummy;
detached_ptr<item> det = item::spawn( "xanax", calendar::start_of_cataclysm,
item::default_charges_tag{} );
detached_ptr<item> det = item::spawn( "xanax", calendar::start_of_cataclysm );
item &xanax = *det;
dummy.i_add( std::move( det ) );

Expand Down

0 comments on commit 23c6368

Please sign in to comment.