Skip to content

Commit

Permalink
validate battery capacity
Browse files Browse the repository at this point in the history
  • Loading branch information
ymber committed Jul 6, 2019
1 parent 6c3427b commit 82f95a5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/item_factory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -973,6 +973,11 @@ void Item_factory::check_definitions() const
msg << string_format( "invalid drop item %s", type->ammo->drop.c_str() ) << "\n";
}
}
if( type->battery ) {
if( type->battery->max_capacity < 0_mJ ) {
msg << "battery cannot have negative maximum charge\n";
}
}
if( type->gun ) {
for( const ammotype &at : type->gun->ammo ) {
check_ammo_type( msg, at );
Expand Down

0 comments on commit 82f95a5

Please sign in to comment.