Implement a proper end and restart race in network

This commit is contained in:
Benau
2018-04-18 15:18:55 +08:00
parent 6eaa88a3f5
commit 99a25bb837
14 changed files with 167 additions and 157 deletions

View File

@@ -161,10 +161,11 @@ bool LocalPlayerController::action(PlayerAction action, int value,
NetworkConfig::get()->isClient() &&
!RewindManager::get()->isRewinding() )
{
GameProtocol::lock()
->controllerAction(m_kart->getWorldKartId(),
action, value,
m_steer_val_l, m_steer_val_r);
if (auto gp = GameProtocol::lock())
{
gp->controllerAction(m_kart->getWorldKartId(), action, value,
m_steer_val_l, m_steer_val_r);
}
}
return PlayerController::action(action, value, /*dry_run*/false);
} // action