Skip to content

Commit

Permalink
item: fix magazine_default for null ammo (#57115)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrei8l authored Apr 24, 2022
1 parent 19a2a8d commit 2432b5c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/item.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10319,8 +10319,8 @@ bool item::uses_magazine() const
itype_id item::magazine_default( bool conversion ) const
{
// consider modded ammo types
if( conversion && !ammo_types().empty() ) {
const itype_id ammo = ammo_default();
itype_id ammo;
if( conversion && ( ammo = ammo_default(), !ammo.is_null() ) ) {
for( const itype_id &mag : contents.magazine_compatible() ) {
auto mag_types = mag->magazine->type;
if( mag_types.find( ammo->ammo->type ) != mag_types.end() ) {
Expand Down

0 comments on commit 2432b5c

Please sign in to comment.