Skip to content

Commit

Permalink
Disable smoothing network body for local kart
Browse files Browse the repository at this point in the history
This should improve collision handling and remove into ground kart
  • Loading branch information
Benau committed Nov 6, 2019
1 parent 1d38496 commit 310caeb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/karts/kart.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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())
{
Expand Down
12 changes: 9 additions & 3 deletions src/karts/kart_rewinder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 310caeb

Please sign in to comment.