From 9947c87fe176c844a333b038288329e1de33fcdc Mon Sep 17 00:00:00 2001 From: Benau Date: Thu, 15 Sep 2022 01:11:14 +0800 Subject: [PATCH] Fix #4795 --- src/karts/abstract_kart.cpp | 10 ++++++++-- src/karts/abstract_kart.hpp | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/karts/abstract_kart.cpp b/src/karts/abstract_kart.cpp index ad9aee587..b83f2473f 100644 --- a/src/karts/abstract_kart.cpp +++ b/src/karts/abstract_kart.cpp @@ -46,8 +46,14 @@ AbstractKart::AbstractKart(const std::string& ident, : Moveable() { m_world_kart_id = world_kart_id; - const RemoteKartInfo& rki = RaceManager::get()->getKartInfo(m_world_kart_id); - loadKartProperties(ident, handicap, ri, rki.getKartData()); + if (RaceManager::get()->getKartGlobalPlayerId(m_world_kart_id) > -1) + { + const RemoteKartInfo& rki = RaceManager::get()->getKartInfo( + m_world_kart_id); + loadKartProperties(ident, handicap, ri, rki.getKartData()); + } + else + loadKartProperties(ident, handicap, ri); } // AbstractKart // ---------------------------------------------------------------------------- diff --git a/src/karts/abstract_kart.hpp b/src/karts/abstract_kart.hpp index 90ba9ec13..28e86a669 100644 --- a/src/karts/abstract_kart.hpp +++ b/src/karts/abstract_kart.hpp @@ -82,7 +82,7 @@ private: void loadKartProperties(const std::string& new_ident, HandicapLevel handicap, std::shared_ptr ri, - const KartData& kart_data); + const KartData& kart_data = KartData()); protected: btTransform m_starting_transform;