From 47ed86dda4a2191a8b648679b641e6cedc6c931e Mon Sep 17 00:00:00 2001 From: Mark Schreiber Date: Fri, 14 Jun 2019 19:08:40 -0700 Subject: [PATCH] Fix UPS guns for multiple ammotype support Recent support for multiple ammotypes broke UPS guns, as they have no ammotype. Fix. --- src/veh_type.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/veh_type.cpp b/src/veh_type.cpp index 29bdd288891c2..ab6d37e845e4b 100644 --- a/src/veh_type.cpp +++ b/src/veh_type.cpp @@ -1061,7 +1061,9 @@ void vehicle_prototype::finalize() } } if( pt.ammo_types.empty() ) { - pt.ammo_types.insert( ammotype( *base->gun->ammo.begin() )->default_ammotype() ); + if (!base->gun->ammo.empty()) { + pt.ammo_types.insert( ammotype( *base->gun->ammo.begin() )->default_ammotype() ); + } } }