From d77fc45e7fea13874fb330299f7f3c8f62198a35 Mon Sep 17 00:00:00 2001 From: Allanis Date: Wed, 27 Feb 2013 22:58:23 +0000 Subject: [PATCH] [Fix] Missiles don't go crazy when enemy has been killed. --- src/weapon.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/weapon.c b/src/weapon.c index fa5c274..f698c29 100644 --- a/src/weapon.c +++ b/src/weapon.c @@ -118,7 +118,11 @@ static void think_seeker(Weapon* w) { if(w->target == w->parent) return; // HEY! Self harm is not allowed. Pilot* p = pilot_get(w->target); - if(p == NULL) return; // Can't do anything with no pilots. + if(p == NULL) { + if(VMOD(w->solid->vel) > w->outfit->u.amm.speed) // Should not go faster. + vect_pset(&w->solid->vel, w->outfit->u.amm.speed, VANGLE(w->solid->vel)); + return; + } // Ammo isn't locked on yet.. if(SDL_GetTicks() > (w->timer + w->outfit->u.amm.lockon)) {