From a76c929033e45bdfd7fb719ade894164273b699c Mon Sep 17 00:00:00 2001 From: hikerstk Date: Mon, 28 Apr 2008 12:34:51 +0000 Subject: [PATCH] Explosion now don't affect the kart that shot the rocket (unless it's a direct hit). git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/trunk/supertuxkart@1766 178a84e3-b1eb-0310-8ba1-8eac791a3b58 --- src/flyable.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/flyable.cpp b/src/flyable.cpp index 8f97fc8e0..3204ceaa3 100644 --- a/src/flyable.cpp +++ b/src/flyable.cpp @@ -227,8 +227,14 @@ void Flyable::explode(Kart *kart_hit, MovingPhysics* moving_physics) for ( unsigned int i = 0 ; i < race_manager->getNumKarts() ; i++ ) { Kart *kart = world->getKart(i); - // handle the actual explosion. Set a flag it if was a direct hit. - kart->handleExplosion(m_curr_pos.xyz, kart==kart_hit); + // Handle the actual explosion. The kart that fired a flyable will + // only be affected if it's a direct hit. This allows karts to use + // rockets on short distance. + if(m_owner!=kart || m_owner==kart_hit) + { + // Set a flag it if was a direct hit. + kart->handleExplosion(m_curr_pos.xyz, kart==kart_hit); + } } callback_manager->handleExplosion(pos, moving_physics); } // explode