[Add] Pilots lose their cargo when the die.
This commit is contained in:
parent
8a294f76c0
commit
e1308dc570
@ -380,6 +380,7 @@ void pilot_render(Pilot* p) {
|
|||||||
|
|
||||||
/* Update the pilot. */
|
/* Update the pilot. */
|
||||||
static void pilot_update(Pilot* pilot, const double dt) {
|
static void pilot_update(Pilot* pilot, const double dt) {
|
||||||
|
int i;
|
||||||
unsigned int t, l;
|
unsigned int t, l;
|
||||||
double a, px, py, vx, vy;
|
double a, px, py, vx, vy;
|
||||||
|
|
||||||
@ -400,6 +401,11 @@ static void pilot_update(Pilot* pilot, const double dt) {
|
|||||||
VX(pilot->solid->pos), VY(pilot->solid->pos),
|
VX(pilot->solid->pos), VY(pilot->solid->pos),
|
||||||
VX(pilot->solid->vel), VY(pilot->solid->vel), SPFX_LAYER_BACK);
|
VX(pilot->solid->vel), VY(pilot->solid->vel), SPFX_LAYER_BACK);
|
||||||
pilot_setFlag(pilot, PILOT_EXPLODED);
|
pilot_setFlag(pilot, PILOT_EXPLODED);
|
||||||
|
|
||||||
|
/* Release cargo. */
|
||||||
|
for(i = 0; i < pilot->ncommodities; i++)
|
||||||
|
commodity_Jettison(pilot->id, pilot->commodities[i].commodity,
|
||||||
|
pilot->commodities[i].quantity);
|
||||||
}
|
}
|
||||||
/* Reset random explosion time. */
|
/* Reset random explosion time. */
|
||||||
else if(t > pilot->timer[1]) {
|
else if(t > pilot->timer[1]) {
|
||||||
|
Loading…
Reference in New Issue
Block a user