Skip to content
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

Refactor and consolidate wield #79719

Draft
wants to merge 26 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge branch 'master' of https://github.com/CleverRaven/Cataclysm-DDA
…into refactor-wield
  • Loading branch information
marilynias committed Feb 20, 2025
commit 2fca12052f719c2461d69c4ca229e1ef11130ec4
5 changes: 4 additions & 1 deletion src/activity_actor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5424,7 +5424,10 @@ void reload_activity_actor::finish( player_activity &act, Character &who )
switch( reload_query.ret ) {
case 1:
// This case is only reachable if wield_check is true
who.wield( target_loc );

if( who.wield( target_loc ) ) {
loc.remove_item();
}
add_msg( m_neutral, _( "The %s no longer fits in your inventory so you wield it instead." ),
reloadable_name );
break;
Expand Down
6 changes: 4 additions & 2 deletions src/npc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1516,7 +1516,9 @@ void npc::stow_item( item &it )
// TODO: implement npc specific calls
// bool npc::wield( item &it )
// {
// // TODO: also move to item_location
// const map &here = get_map();

// TODO: also move to item_location
// // sanity check: exit early if we're trying to wield the current weapon
// // needed for ranged_balance_test
// if( is_wielding( it ) ) {
Expand Down Expand Up @@ -1555,7 +1557,7 @@ void npc::stow_item( item &it )
// cata::event e = cata::event::make<event_type::character_wields_item>( getID(), weapon->typeId() );
// get_event_bus().send_with_talker( this, &weapon, e );

// if( get_player_view().sees( pos_bub() ) ) {
// if( get_player_view().sees( here, pos_bub( here ) ) ) {
// add_msg_if_npc( m_info, _( "<npcname> wields a %s." ), weapon->tname() );
// }
// invalidate_range_cache();
Expand Down
Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.