diff --git a/src/items/item_manager.cpp b/src/items/item_manager.cpp index 24bf8f4dc..ce0e519d8 100644 --- a/src/items/item_manager.cpp +++ b/src/items/item_manager.cpp @@ -324,7 +324,7 @@ void ItemManager::checkItemHit(AbstractKart* kart) if((*i)->hitKart(kart->getXYZ(), kart)) { // if we're not playing online, pick the item. - if (!RaceEventManager::getInstance()->isRunning()) + if (!NetworkConfig::get()->isNetworking()) collectedItem(*i, kart); else if (NetworkConfig::get()->isServer()) { diff --git a/src/karts/kart.cpp b/src/karts/kart.cpp index b4d250c22..b9c1e49c4 100644 --- a/src/karts/kart.cpp +++ b/src/karts/kart.cpp @@ -67,7 +67,6 @@ #include "modes/soccer_world.hpp" #include "modes/world.hpp" #include "network/network_config.hpp" -#include "network/race_event_manager.hpp" #include "network/rewind_manager.hpp" #include "physics/btKart.hpp" #include "physics/btKartRaycast.hpp" @@ -1477,8 +1476,8 @@ void Kart::update(float dt) // Check if any item was hit. // check it if we're not in a network world, or if we're on the server // (when network mode is on) - if (!RaceEventManager::getInstance()->isRunning() || - NetworkConfig::get()->isServer()) + if(!NetworkConfig::get()->isNetworking() || + NetworkConfig::get()->isServer() ) ItemManager::get()->checkItemHit(this); static video::SColor pink(255, 255, 133, 253); diff --git a/src/main_loop.cpp b/src/main_loop.cpp index e647d2a15..84f329a8e 100644 --- a/src/main_loop.cpp +++ b/src/main_loop.cpp @@ -141,7 +141,8 @@ float MainLoop::getLimitedDt() void MainLoop::updateRace(float dt) { // The race event manager will update world in case of an online race - if (RaceEventManager::getInstance()->isRunning()) + if ( RaceEventManager::getInstance() && + RaceEventManager::getInstance()->isRunning() ) RaceEventManager::getInstance()->update(dt); else World::getWorld()->updateWorld(dt);