Bugfix: client didn't show the speed of the karts correctly.

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/trunk/supertuxkart@2251 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
hikerstk 2008-09-08 10:01:48 +00:00
parent 1c97237940
commit a4ce04aaf7

View File

@ -880,8 +880,10 @@ void Kart::updatePhysics (float dt)
m_vehicle->setSteeringValue(0.0f, 1);
}
//store current velocity
m_speed = getVehicle()->getRigidBody()->getLinearVelocity().length();
// Only compute the current speed if this is not the client. On a client the
// speed is actually received from the server.
if(network_manager->getMode()!=NetworkManager::NW_CLIENT)
m_speed = getVehicle()->getRigidBody()->getLinearVelocity().length();
// calculate direction of m_speed
const btTransform& chassisTrans = getVehicle()->getChassisWorldTransform();