diff --git a/data/stk_config.xml b/data/stk_config.xml index 1208fbe0c..a5439750d 100644 --- a/data/stk_config.xml +++ b/data/stk_config.xml @@ -94,8 +94,10 @@ - + lbound-fraction is the lower bound fraction of speed when lost will detach parachute + ubound-fraction is the upper bound fraction of speed when lost will detach parachute + max-speed is a factor that decides the impact of rate of speed (distance between bounds) --> + diff --git a/src/config/stk_config.cpp b/src/config/stk_config.cpp index 1f302994c..6c9923410 100644 --- a/src/config/stk_config.cpp +++ b/src/config/stk_config.cpp @@ -109,7 +109,9 @@ void STKConfig::load(const std::string &filename) CHECK_NEG(m_max_karts, "getNode("parachute")) { - parachute_node->get("friction", &m_parachute_friction ); - parachute_node->get("time", &m_parachute_time ); - parachute_node->get("time-other", &m_parachute_time_other ); - parachute_node->get("done-fraction", &m_parachute_done_fraction); + parachute_node->get("friction", &m_parachute_friction ); + parachute_node->get("time", &m_parachute_time ); + parachute_node->get("time-other", &m_parachute_time_other ); + parachute_node->get("lbound-fraction", &m_parachute_lbound_fraction); + parachute_node->get("ubound-fraction", &m_parachute_ubound_fraction); + parachute_node->get("max-speed", &m_parachute_max_speed ); } if(const XMLNode *bomb_node= root->getNode("bomb")) diff --git a/src/config/stk_config.hpp b/src/config/stk_config.hpp index 2fcdbeed5..d24a49ba6 100644 --- a/src/config/stk_config.hpp +++ b/src/config/stk_config.hpp @@ -60,37 +60,40 @@ public: m_same_powerup_mode; static float UNDEFINED; - float m_anvil_weight; /**getSpeed() <= - m_initial_speed*stk_config->m_parachute_done_fraction) + // This percentage is based on the ratio of + // initial_speed / initial_max_speed + + if(m_kart->getSpeed() <= m_initial_speed * (stk_config->m_parachute_lbound_fraction + + ((m_initial_speed / stk_config->m_parachute_max_speed) * (stk_config->m_parachute_ubound_fraction - + stk_config->m_parachute_lbound_fraction)))) { m_time_left = -1; }