Skip to content

Conversation

@http-418
Copy link

@http-418 http-418 commented Nov 7, 2025

Summary

Features: "Honor theft preference inside the Advanced Inventory Management screens"

Purpose of change

I found it maddeningly difficult to round up items from a bandit camp because both Advanced Inventory Management (AIM) and "sort zones" will refuse to steal items owned by another faction.

This has come up before, e.g. #66004

It was relatively easy to fix AIM. "Sort zones" and generalized activity fixes will have to wait for another day.

Describe the solution

With this PR, AIM will now honor the preference set via THIEF_MODE

  • If set to the default THIEF_HONEST, AIM will not move any non-owned item
  • If set to THIEF_ASK, AIM will retain the default behavior, because it would be too annoying to deal with multiple prompts.
  • Finally, if set to THIEF_STEAL, AIM will still display the red indicators that moving this item would be stealing, but it will honor your requests.

Describe alternatives you've considered

Ideally I would like to find a solution that covers both AIM and zone sorting stuff, since they both pass through activity_actor and friends. I'm not there yet.

Testing

This works great as a practical matter. As a player, I routinely change my THIEF_MODE with a keybinding based on whether I am looting a bandit camp or not.

I wrote no real tests, in the ctest sense. I didn't find any other testing for THIEF_MODE, so I wasn't super clear on what the setup should be.

Additional context

N/A

@github-actions github-actions bot added [C++] Changes (can be) made in C++. Previously named `Code` new contributor labels Nov 7, 2025
@github-actions github-actions bot added json-styled JSON lint passed, label assigned by github actions astyled astyled PR, label is assigned by github actions labels Nov 7, 2025
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit

[JSON & C++ formatters](https://github.com/CleverRaven/Cataclysm-DDA/blob/master/doc/c++/DEVELOPER_TOOLING.md)

[JSON & C++ formatters] reported by reviewdog 🐶

!ammo_uses_speedloader_clip ) {


[JSON & C++ formatters] reported by reviewdog 🐶

case 1:
// This case is only reachable if wield_check is true


[JSON & C++ formatters] reported by reviewdog 🐶

who.wield( target_loc );
add_msg( m_neutral, _( "The %s no longer fits in your inventory so you wield it instead." ),
reloadable_name );
break;
case 2:
default:
// In player inventory and player is wielding something.
if( loc.carrier() ) {
loc.carrier()->add_msg_if_player( m_neutral,
_( "The %s no longer fits in your inventory so you drop it instead." ),
reloadable_name );
}
here.add_item_or_charges( loc.pos_bub( here ), reloadable );
loc.remove_item();
break;


[JSON & C++ formatters] reported by reviewdog 🐶

case LD_ITEM:
jsout.member( "target_item_loc", target.item_loc );
break;


[JSON & C++ formatters] reported by reviewdog 🐶

case LD_KEG:
jsout.member( "target_pos", target.pos );
break;


[JSON & C++ formatters] reported by reviewdog 🐶

case LD_NULL:
case LD_CONSUME:
case LD_GROUND:
case LD_VEH:
break;


[JSON & C++ formatters] reported by reviewdog 🐶

case LD_ITEM:
data.read( "target_item_loc", actor.target.item_loc );
break;


[JSON & C++ formatters] reported by reviewdog 🐶

case LD_KEG:
data.read( "target_pos", actor.target.pos );
break;


[JSON & C++ formatters] reported by reviewdog 🐶

case LD_NULL:
case LD_CONSUME:
case LD_GROUND:
case LD_VEH:
actor.target.dest_opt = LD_NULL;
break;


[JSON & C++ formatters] reported by reviewdog 🐶

query_yn(
_( "Your %1$s doesn't have enough charges to complete the job. Continue anyway?" ), tool->tname()
) ||
test_mode // In the tests, we want to check that the activity can be resumed.


[JSON & C++ formatters] reported by reviewdog 🐶

( who.backlog.empty() || who.backlog.front().id() != ACT_MULTIPLE_CHOP_TREES ) ) {


[JSON & C++ formatters] reported by reviewdog 🐶

it->use_charges( it->typeId(), charges_consumed, used, it.pos_bub( here ) ) ) {


[JSON & C++ formatters] reported by reviewdog 🐶

backlog_act.id() == ACT_CONSUME_MEDS_MENU ) {


[JSON & C++ formatters] reported by reviewdog 🐶

case SPRING:
group_id = Item_spawn_data_forage_spring;
break;
case SUMMER:
group_id = Item_spawn_data_forage_summer;
break;
case AUTUMN:
group_id = Item_spawn_data_forage_autumn;
break;
case WINTER:
group_id = Item_spawn_data_forage_winter;
break;
default:
debugmsg( "Invalid season" );


[JSON & C++ formatters] reported by reviewdog 🐶

mgr.get_near( zone_type_UNLOAD_ALL, abspos, MAX_VIEW_DISTANCE, nullptr,
fac_id ) ) {


[JSON & C++ formatters] reported by reviewdog 🐶

mgr.get_near( zone_type_STRIP_CORPSES, abspos, MAX_VIEW_DISTANCE, nullptr,
fac_id ) ) {


[JSON & C++ formatters] reported by reviewdog 🐶

here.get_field( src_loc, fd_fire ) != nullptr ||
!here.can_put_items_ter_furn( src_loc ) || here.impassable_field_at( src_loc ) ) {


[JSON & C++ formatters] reported by reviewdog 🐶

( mgr.has_near( zone_type_STRIP_CORPSES, abspos, 1, fac_id ) && it->first->is_corpse() ) ) {


[JSON & C++ formatters] reported by reviewdog 🐶

!it->first->any_pockets_sealed() ) {


[JSON & C++ formatters] reported by reviewdog 🐶

item_counts[contained->typeId()] > unload_sparse_threshold ) {


[JSON & C++ formatters] reported by reviewdog 🐶

h.heating_effect ) {


[JSON & C++ formatters] reported by reviewdog 🐶

!crafting_inv.has_charges( itype_water_clean, requirements.water, is_liquid_crafting_component ) ) {


[JSON & C++ formatters] reported by reviewdog 🐶

case butcher_type::BLEED: {
return ACT_BLEED;
break;
}
case butcher_type::QUICK: {
return ACT_BUTCHER;
break;
}
case butcher_type::FULL: {
return ACT_BUTCHER_FULL;
break;
}
case butcher_type::FIELD_DRESS: {
return ACT_FIELD_DRESS;
break;
}
case butcher_type::SKIN: {
return ACT_SKIN;
break;
}
case butcher_type::QUARTER: {
return ACT_QUARTER;
break;
}
case butcher_type::DISMEMBER: {
return ACT_DISMEMBER;
break;
}
case butcher_type::DISSECT: {
return ACT_DISSECT;
break;
}
default : {
return ACT_BUTCHER;
break;
}

@http-418
Copy link
Author

http-418 commented Nov 7, 2025

Sorry, folks, I was trying to use base astyle and did not, until just now, notice that make astyle was the correct invocation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

astyled astyled PR, label is assigned by github actions [C++] Changes (can be) made in C++. Previously named `Code` json-styled JSON lint passed, label assigned by github actions new contributor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant