diff --git a/src/pilot.c b/src/pilot.c index 493494c..caa21ee 100644 --- a/src/pilot.c +++ b/src/pilot.c @@ -127,7 +127,8 @@ void pilot_shoot(Pilot* p, const unsigned int target, const int secondary) { static void pilot_shootWeapon(Pilot* p, PilotOutfit* w, const unsigned int t) { // WElll... Trying to shoot when you have no ammo?? FUUU - int quantity = outfit_isAmmo(w->outfit) ? p->secondary->quantity : w->quantity; + int quantity = (outfit_isAmmo(w->outfit) && p->secondary) ? + p->secondary->quantity : w->quantity; // Check to see if weapon is ready. if((SDL_GetTicks() - w->timer) < (w->outfit->delay / quantity)) return;