[Fix] Remove the outfit when you run out of ammo.

This commit is contained in:
Allanis 2013-10-30 21:50:44 +00:00
parent b7ee0eb32a
commit 9c9a7e07ca

View File

@ -316,6 +316,8 @@ static void pilot_shootWeapon(Pilot* p, PilotOutfit* w, const unsigned int t) {
&p->solid->vel, p->id, t); &p->solid->vel, p->id, t);
p->ammo->quantity -= 1; /* There's no getting this one back. */ p->ammo->quantity -= 1; /* There's no getting this one back. */
if(p->ammo->quantity <= 0) /* Out of ammo. */
pilot_rmOutfit(p, p->ammo->outfit, 0); /* It'll set p->ammo to NULL. */
} else { } else {
WARN("Shooting unknown weapon type: %s", w->outfit->name); WARN("Shooting unknown weapon type: %s", w->outfit->name);
} }