Skip to content

Commit

Permalink
fix crash with flashlight
Browse files Browse the repository at this point in the history
  • Loading branch information
KorGgenT authored and kevingranade committed May 24, 2020
1 parent 621ed60 commit 69ff39a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/item.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7906,7 +7906,7 @@ int item::getlight_emit() const
{
float lumint = type->light_emission;

if( lumint == 0 ) {
if( lumint == 0 || ammo_remaining() == 0 ) {
return 0;
}
if( has_flag( flag_CHARGEDIM ) && is_tool() && !has_flag( flag_USE_UPS ) ) {
Expand Down

0 comments on commit 69ff39a

Please sign in to comment.