Fix ghost replay crashes

This commit is contained in:
Benau
2018-07-20 19:23:18 +08:00
parent d4f7d6baaa
commit 82b23b6c26
2 changed files with 6 additions and 1 deletions

View File

@@ -858,6 +858,8 @@ void Kart::adjustSpeed(float f)
*/
void Kart::updateWeight()
{
if (!m_body)
return;
float mass = m_kart_properties->getMass() + m_attachment->weightAdjust();
if (m_weight != mass)
{

View File

@@ -62,7 +62,10 @@ void Moveable::setNode(scene::ISceneNode *n)
//-----------------------------------------------------------------------------
void Moveable::updateSmoothedGraphics(float dt)
{
SmoothNetworkBody::updateSmoothedGraphics(m_transform, getVelocity(), dt);
Vec3 velocity;
if (m_body)
velocity = m_body->getLinearVelocity();
SmoothNetworkBody::updateSmoothedGraphics(m_transform, velocity, dt);
#undef DEBUG_SMOOTHING
#ifdef DEBUG_SMOOTHING
// Gnuplot compare command