[Fix] Remove the outfit when you run out of ammo.
This commit is contained in:
parent
b7ee0eb32a
commit
9c9a7e07ca
@ -316,6 +316,8 @@ static void pilot_shootWeapon(Pilot* p, PilotOutfit* w, const unsigned int t) {
|
||||
&p->solid->vel, p->id, t);
|
||||
|
||||
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 {
|
||||
WARN("Shooting unknown weapon type: %s", w->outfit->name);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user