iDisable steering for players when a skid is stopped (till the physics are

aligned with the graphics again). That _may_ help with controlling the
kart better after skid. Testwise enabled by default - feedback welcome.


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@11587 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
hikerstk 2012-09-16 22:50:59 +00:00
parent 5ec5f6c2c8
commit 7b99faeeb8
5 changed files with 26 additions and 1 deletions

View File

@ -109,6 +109,10 @@
work anymore - so for now don't enable this. -->
<networking enable="false"/>
<!-- Disable steering when stop skidding during the time it takes to
adjust the physical body with the graphics. -->
<steer disable-while-unskid="true"/>
<!-- Default values for all karts
============================ -->
<general-kart-defaults>

View File

@ -177,6 +177,7 @@ void STKConfig::init_defaults()
m_smooth_normals = false;
m_same_powerup_mode = POWERUP_MODE_ONLY_IF_SAME;
m_ai_acceleration = 1.0f;
m_disable_steer_while_unskid = false;
m_score_increase.clear();
m_leader_intervals.clear();
@ -252,6 +253,11 @@ void STKConfig::getAllData(const XMLNode * root)
news_node->get("max-display", &m_max_display_news);
}
if (const XMLNode *steer_node= root->getNode("steer"))
{
steer_node->get("disable-while-unskid", &m_disable_steer_while_unskid);
}
if (const XMLNode *music_node = root->getNode("music"))
{
std::string title_music;

View File

@ -103,6 +103,12 @@ public:
before it is ignored. */
bool m_enable_networking;
/** Disable steering if skidding is stopped. This can help in making
* skidding more controllable (since otherwise when trying to steer while
* steering is reset to match the graphics it often results in the kart
* crashing). */
bool m_disable_steer_while_unskid;
float m_ai_acceleration; /**<Between 0 and 1, default being 1, can be
used to give a handicap to AIs */

View File

@ -411,7 +411,7 @@ void Camera::getCameraSettings(float *above_kart, float *cam_angle,
break;
}
} // get CameraPosition
} // getCameraSettings
//-----------------------------------------------------------------------------
/** Called once per time frame to move the camera to the right position.

View File

@ -22,6 +22,7 @@
#include "audio/sfx_base.hpp"
#include "audio/sfx_manager.hpp"
#include "config/player.hpp"
#include "config/stk_config.hpp"
#include "graphics/camera.hpp"
#include "graphics/irr_driver.hpp"
#include "input/input_manager.hpp"
@ -30,6 +31,7 @@
#include "items/powerup.hpp"
#include "karts/abstract_kart.hpp"
#include "karts/kart_properties.hpp"
#include "karts/skidding.hpp"
#include "karts/rescue_animation.hpp"
#include "modes/world.hpp"
#include "race/history.hpp"
@ -228,6 +230,13 @@ void PlayerController::steer(float dt, int steer_val)
gui_base->addMessage(StringUtils::insertValues(L"steer_val %i", steer_val), m_kart, 1.0f,
video::SColor(255, 255, 0, 255), false);
}
if(stk_config->m_disable_steer_while_unskid &&
!m_controls->m_skid &&
m_kart->getSkidding()->getVisualSkidRotation()!=0)
{
m_controls->m_steer = 0;
}
const float STEER_CHANGE = dt/m_kart->getTimeFullSteer(); // amount the steering is changed
if (steer_val < 0)
{