From 8313bcb0d2e6e1f4b6164a86608fb2bf2b406baf Mon Sep 17 00:00:00 2001 From: hiker Date: Thu, 30 Jan 2014 12:29:05 +1100 Subject: [PATCH] Trigger rescue only when the kart is not on gravity terrain. --- src/karts/kart.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/karts/kart.cpp b/src/karts/kart.cpp index 816187494..f9b27c3da 100644 --- a/src/karts/kart.cpp +++ b/src/karts/kart.cpp @@ -1177,8 +1177,14 @@ void Kart::update(float dt) m_skid_sound->position ( getXYZ() ); m_boing_sound->position ( getXYZ() ); - // Check if a kart is (nearly) upside down and not moving much --> automatic rescue - if(World::getWorld()->getTrack()->isAutoRescueEnabled() && + // Check if a kart is (nearly) upside down and not moving much --> + // automatic rescue + // But only do this if auto-rescue is enabled (i.e. it will be disabled in + // battle mode), and the material the kart is driving on does not have + // gravity (which can + if(World::getWorld()->getTrack()->isAutoRescueEnabled() && + (!m_terrain_info->getMaterial() || + !m_terrain_info->getMaterial()->hasGravity()) && !getKartAnimation() && fabs(getRoll())>60*DEGREE_TO_RAD && fabs(getSpeed())<3.0f ) {