Skip to content

Commit

Permalink
Merge pull request #77613 from mqrause/reload_fix
Browse files Browse the repository at this point in the history
Fix crash when not wielding item from map/vehicle after reloading
  • Loading branch information
Maleclypse authored Nov 5, 2024
2 parents b1c1cb9 + 0b7c796 commit dae649f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/activity_actor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4976,9 +4976,11 @@ void reload_activity_actor::finish( player_activity &act, Character &who )
case 2:
default:
// In player inventory and player is wielding something.
loc.carrier()->add_msg_if_player( m_neutral,
_( "The %s no longer fits in your inventory so you drop it instead." ),
reloadable_name );
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 );
}
get_map().add_item_or_charges( loc.pos_bub(), reloadable );
loc.remove_item();
break;
Expand Down

0 comments on commit dae649f

Please sign in to comment.