Disable smoothing network body for local kart

This should improve collision handling and remove into ground kart
This commit is contained in:
Benau
2019-11-07 01:48:05 +08:00
parent 1d384961dd
commit 310caebc34
2 changed files with 11 additions and 4 deletions

View File

@@ -3207,7 +3207,8 @@ void Kart::updateGraphics(float dt)
// Disable smoothing network body so it doesn't smooth the animation
// for karts in client
if (NetworkConfig::get()->isNetworking() &&
NetworkConfig::get()->isClient())
NetworkConfig::get()->isClient() &&
(!getController() || !getController()->isLocalPlayerController()))
{
if (m_kart_animation && SmoothNetworkBody::isEnabled())
{

View File

@@ -67,9 +67,15 @@ void KartRewinder::reset()
{
Kart::reset();
Rewinder::reset();
SmoothNetworkBody::setEnable(true);
SmoothNetworkBody::setSmoothRotation(true);
SmoothNetworkBody::setAdjustVerticalOffset(true);
// Can be null for the first time
if (getController() && !getController()->isLocalPlayerController())
{
SmoothNetworkBody::setEnable(true);
SmoothNetworkBody::setSmoothRotation(true);
SmoothNetworkBody::setAdjustVerticalOffset(true);
}
else
SmoothNetworkBody::setEnable(false);
m_has_server_state = false;
} // reset