/** Checks if the kart was overtaken, and if so plays a sound */ void NetworkPlayerController::setPosition(int p) { if(m_kart->getPosition()<p) { World *world = World::getWorld(); //have the kart that did the passing beep. //I'm not sure if this method of finding the passing kart is fail-safe. for(unsigned int i = 0 ; i < world->getNumKarts(); i++ ) { AbstractKart *kart = world->getKart(i); if(kart->getPosition() == p + 1) { kart->beep(); break; } } } } // setPosition