Skip to content

Commit d85b30d

Browse files
authored
Fix potentially uninitialized variable used error (#84380)
Co-authored-by: akrieger <[email protected]>
1 parent 9d347e8 commit d85b30d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/ranged.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -729,7 +729,7 @@ bool Character::handle_gun_damage( item &it )
729729

730730

731731
// i am bad at math, so we will use vibes instead
732-
double gun_jam_chance;
732+
double gun_jam_chance = 0;
733733
int gun_damage = it.damage() / 1000.0;
734734
switch( gun_damage ) {
735735
case 0:
@@ -749,7 +749,7 @@ bool Character::handle_gun_damage( item &it )
749749
break;
750750
}
751751

752-
int mag_damage;
752+
int mag_damage = 0;
753753
double mag_jam_chance = 0;
754754
if( it.magazine_current() ) {
755755
mag_damage = it.magazine_current()->damage() / 1000.0;

0 commit comments

Comments
 (0)