From 9e3ba88f980a5d5bb1064ffc60d02c3e204280e9 Mon Sep 17 00:00:00 2001 From: auria Date: Thu, 5 Apr 2012 02:28:21 +0000 Subject: [PATCH] Don't allow starting a race from overworld while being rescued git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@11091 178a84e3-b1eb-0310-8ba1-8eac791a3b58 --- src/modes/overworld.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/modes/overworld.cpp b/src/modes/overworld.cpp index 650e563df..41459d900 100644 --- a/src/modes/overworld.cpp +++ b/src/modes/overworld.cpp @@ -22,6 +22,7 @@ #include "karts/abstract_kart.hpp" #include "karts/kart_properties.hpp" #include "karts/kart_properties_manager.hpp" +#include "karts/rescue_animation.hpp" #include "modes/overworld.hpp" #include "network/network_manager.hpp" #include "states_screens/dialogs/select_challenge.hpp" @@ -159,7 +160,14 @@ void OverWorld::onFirePressed(Controller* who) { const std::vector& challenges = m_track->getChallengeList(); - Vec3 kart_xyz = getKart(0)->getXYZ(); + AbstractKart* k = getKart(0); + Vec3 kart_xyz = k->getXYZ(); + if (dynamic_cast(k->getKartAnimation()) != NULL) + { + // you can't start a race while being rescued + return; + } + for (unsigned int n=0; n