From 05fb68a706d33671a9efabe0c2403be835090908 Mon Sep 17 00:00:00 2001 From: hikerstk Date: Fri, 2 Dec 2011 09:41:00 +0000 Subject: [PATCH] Added debug output when a kart hits the track (for people playing without sound ;) ). Needs --physics-debug command line flag. git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@10300 178a84e3-b1eb-0310-8ba1-8eac791a3b58 --- src/karts/kart.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/karts/kart.cpp b/src/karts/kart.cpp index 8e91accec..ee852501d 100644 --- a/src/karts/kart.cpp +++ b/src/karts/kart.cpp @@ -1407,6 +1407,20 @@ void Kart::resetBrakes() */ void Kart::crashed(Kart *k, const Material *m) { +#ifdef DEBUG + // Simple debug output for people playing without sound. + // This makes it easier to see if a kart hit the track (esp. + // after a jump). + // FIXME: This should be removed once the physics are fixed. + if(!k && UserConfigParams::m_physics_debug) + { + // Add a counter to make it easier to see if a new line of + // output was added. + static int counter=0; + printf("Kart %s hit track: %d.\n", getIdent().c_str(), counter++); + } +#endif + m_controller->crashed(); /** If a kart is crashing against the track, the collision is often * reported more than once, resulting in a machine gun effect, and too