From 66b3f127f6e17a86fc69cbb88f003a2ab7a4f872 Mon Sep 17 00:00:00 2001 From: hikerstk Date: Fri, 19 Sep 2008 14:41:23 +0000 Subject: [PATCH] Set wheel radius from kart properties, removed compiler warnings. git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/trunk/supertuxkart@2282 178a84e3-b1eb-0310-8ba1-8eac791a3b58 --- src/kart.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/kart.cpp b/src/kart.cpp index 646594804..68b1b2cfa 100644 --- a/src/kart.cpp +++ b/src/kart.cpp @@ -500,11 +500,14 @@ void Kart::collectedHerring(const Herring &herring, int add_info) switch (type) { - case HE_GREEN : m_attachment.hitGreenHerring(herring, add_info); break; - case HE_SILVER : m_num_herrings_gobbled++ ; break; - case HE_GOLD : m_num_herrings_gobbled += 3 ; break; - case HE_RED : int n=1 + 4*getNumHerring() / MAX_HERRING_EATEN; - m_collectable.hitRedHerring(n, herring, add_info); break; + case HE_GREEN : m_attachment.hitGreenHerring(herring, add_info); break; + case HE_SILVER : m_num_herrings_gobbled++ ; break; + case HE_GOLD : m_num_herrings_gobbled += 3 ; break; + case HE_RED : { + int n=1 + 4*getNumHerring() / MAX_HERRING_EATEN; + m_collectable.hitRedHerring(n, herring,add_info);break; + } + default : break; } // switch TYPE // Attachments and collectables are stored in the corresponding @@ -949,7 +952,7 @@ void Kart::updatePhysics (float dt) // tire_diameter //the magic number 1.7 is used to bring the computed gear ratio into a sensible range float gear_ratio = 1.7f + (1 - m_current_gear_ratio); - float tire_diameter = 2;//can this be determined for each kart? Smaller tires make for higher rpm's. + float tire_diameter = m_kart_properties->getWheelRadius(); m_max_gear_rpm = m_current_gear_ratio * max_speed; m_rpm = ((m_speed * gear_ratio) / tire_diameter);