Only deploy mines if you're moving.

This commit is contained in:
Steve 2016-04-01 17:02:56 +01:00
parent cfc41a624b
commit d329fbaf2f
1 changed files with 6 additions and 2 deletions

View File

@ -628,14 +628,18 @@ static void deployMine(void)
{
Entity *mine;
if (!self->reload)
if (!self->reload && self->thrust > 0)
{
mine = spawnMine();
mine->x = self->x;
mine->y = self->y;
mine->dx = rand() % 20 - rand() % 20;
mine->dx *= 0.1;
mine->dy = rand() % 20 - rand() % 20;
mine->dy *= 0.1;
mine->side = self->side;
self->reload = FPS + (FPS * (rand() % 5));
self->reload = rand() % (FPS * 3);
}
}