allow simultaneous cannon firing

This commit is contained in:
Alyssa Milburn 2014-07-26 13:48:04 +02:00
parent 578f7361eb
commit ff851a6b07
1 changed files with 4 additions and 3 deletions

View File

@ -116,13 +116,14 @@ tanks_fire_cannon(struct tanks_game *game,
float theta = this->angle + this->turret.current; float theta = this->angle + this->turret.current;
float rpos[2]; float rpos[2];
/* If someone's a crater, this is easy */ /* If someone's a crater, this is easy (unless we were just killed by the other one, in which case
if (this->killer || that->killer) { we have to check the other direction) */
if ((this->killer && this->killer != that) || that->killer) {
return; return;
} }
/* Did they collide? */ /* Did they collide? */
if (dist2 < TANK_COLLISION_ADJ2) { if ((!this->killer) && dist2 < TANK_COLLISION_ADJ2) {
this->killer = that; this->killer = that;
this->cause_death = "collision"; this->cause_death = "collision";