Use the same item index for server and client

TrackObjectPresentationSound will create item trigger, when network
split screen is used it will be diverged.
This commit is contained in:
Benau 2018-09-28 16:01:08 +08:00
parent 8950354e62
commit dd9bb640d1

View File

@ -167,9 +167,11 @@ void TrackObject::init(const XMLNode &xml_node, scene::ISceneNode* parent,
else if (type == "sfx-emitter")
{
// FIXME: at this time sound emitters are just disabled in multiplayer
// otherwise the sounds would be constantly heard
// otherwise the sounds would be constantly heard, for networking
// the index of item needs to be same so we create and disable it
m_presentation = new TrackObjectPresentationSound(xml_node, parent);
if (race_manager->getNumLocalPlayers() < 2)
m_presentation = new TrackObjectPresentationSound(xml_node, parent);
m_presentation->setEnable(false);
}
else if (type == "action-trigger")
{