-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Honor THIEF_MODE preference in the Advanced Inventory Management screens #83639
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
e694f3d to
1115641
Compare
1115641 to
deb6f1b
Compare
There was a problem hiding this 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 🐶
Cataclysm-DDA/src/activity_actor.cpp
Line 5551 in deb6f1b
| !ammo_uses_speedloader_clip ) { |
[JSON & C++ formatters] reported by reviewdog 🐶
Cataclysm-DDA/src/activity_actor.cpp
Lines 5593 to 5594 in deb6f1b
| case 1: | |
| // This case is only reachable if wield_check is true |
[JSON & C++ formatters] reported by reviewdog 🐶
Cataclysm-DDA/src/activity_actor.cpp
Lines 5596 to 5610 in deb6f1b
| 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 🐶
Cataclysm-DDA/src/activity_actor.cpp
Lines 5733 to 5735 in deb6f1b
| case LD_ITEM: | |
| jsout.member( "target_item_loc", target.item_loc ); | |
| break; |
[JSON & C++ formatters] reported by reviewdog 🐶
Cataclysm-DDA/src/activity_actor.cpp
Lines 5737 to 5739 in deb6f1b
| case LD_KEG: | |
| jsout.member( "target_pos", target.pos ); | |
| break; |
[JSON & C++ formatters] reported by reviewdog 🐶
Cataclysm-DDA/src/activity_actor.cpp
Lines 5741 to 5745 in deb6f1b
| case LD_NULL: | |
| case LD_CONSUME: | |
| case LD_GROUND: | |
| case LD_VEH: | |
| break; |
[JSON & C++ formatters] reported by reviewdog 🐶
Cataclysm-DDA/src/activity_actor.cpp
Lines 5768 to 5770 in deb6f1b
| case LD_ITEM: | |
| data.read( "target_item_loc", actor.target.item_loc ); | |
| break; |
[JSON & C++ formatters] reported by reviewdog 🐶
Cataclysm-DDA/src/activity_actor.cpp
Lines 5772 to 5774 in deb6f1b
| case LD_KEG: | |
| data.read( "target_pos", actor.target.pos ); | |
| break; |
[JSON & C++ formatters] reported by reviewdog 🐶
Cataclysm-DDA/src/activity_actor.cpp
Lines 5776 to 5781 in deb6f1b
| 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 🐶
Cataclysm-DDA/src/activity_actor.cpp
Lines 6119 to 6122 in deb6f1b
| 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 🐶
Cataclysm-DDA/src/activity_actor.cpp
Line 7274 in deb6f1b
| ( who.backlog.empty() || who.backlog.front().id() != ACT_MULTIPLE_CHOP_TREES ) ) { |
[JSON & C++ formatters] reported by reviewdog 🐶
Cataclysm-DDA/src/activity_actor.cpp
Line 7485 in deb6f1b
| it->use_charges( it->typeId(), charges_consumed, used, it.pos_bub( here ) ) ) { |
[JSON & C++ formatters] reported by reviewdog 🐶
Cataclysm-DDA/src/activity_actor.cpp
Line 7501 in deb6f1b
| backlog_act.id() == ACT_CONSUME_MEDS_MENU ) { |
[JSON & C++ formatters] reported by reviewdog 🐶
Cataclysm-DDA/src/activity_actor.cpp
Lines 7569 to 7582 in deb6f1b
| 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 🐶
Cataclysm-DDA/src/activity_actor.cpp
Lines 7952 to 7953 in deb6f1b
| mgr.get_near( zone_type_UNLOAD_ALL, abspos, MAX_VIEW_DISTANCE, nullptr, | |
| fac_id ) ) { |
[JSON & C++ formatters] reported by reviewdog 🐶
Cataclysm-DDA/src/activity_actor.cpp
Lines 7958 to 7959 in deb6f1b
| mgr.get_near( zone_type_STRIP_CORPSES, abspos, MAX_VIEW_DISTANCE, nullptr, | |
| fac_id ) ) { |
[JSON & C++ formatters] reported by reviewdog 🐶
Cataclysm-DDA/src/activity_actor.cpp
Lines 8007 to 8008 in deb6f1b
| 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 🐶
Cataclysm-DDA/src/activity_actor.cpp
Line 8130 in deb6f1b
| ( mgr.has_near( zone_type_STRIP_CORPSES, abspos, 1, fac_id ) && it->first->is_corpse() ) ) { |
[JSON & C++ formatters] reported by reviewdog 🐶
Cataclysm-DDA/src/activity_actor.cpp
Line 8132 in deb6f1b
| !it->first->any_pockets_sealed() ) { |
[JSON & C++ formatters] reported by reviewdog 🐶
Cataclysm-DDA/src/activity_actor.cpp
Line 8145 in deb6f1b
| item_counts[contained->typeId()] > unload_sparse_threshold ) { |
[JSON & C++ formatters] reported by reviewdog 🐶
Cataclysm-DDA/src/activity_actor.cpp
Line 8519 in deb6f1b
| h.heating_effect ) { |
[JSON & C++ formatters] reported by reviewdog 🐶
Cataclysm-DDA/src/activity_actor.cpp
Line 8633 in deb6f1b
| !crafting_inv.has_charges( itype_water_clean, requirements.water, is_liquid_crafting_component ) ) { |
[JSON & C++ formatters] reported by reviewdog 🐶
Cataclysm-DDA/src/activity_actor.cpp
Lines 9083 to 9118 in deb6f1b
| 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; | |
| } |
deb6f1b to
aec4ccd
Compare
|
Sorry, folks, I was trying to use base |
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_MODETHIEF_HONEST, AIM will not move any non-owned itemTHIEF_ASK, AIM will retain the default behavior, because it would be too annoying to deal with multiple prompts.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
ctestsense. 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