From: <wha...@us...> - 2011-06-14 23:36:41
|
Revision: 7416 http://planeshift.svn.sourceforge.net/planeshift/?rev=7416&view=rev Author: whacko88 Date: 2011-06-14 23:36:35 +0000 (Tue, 14 Jun 2011) Log Message: ----------- fixed some bugs that brought to the client crash Modified Paths: -------------- soc/2011/sound/src/plugins/common/soundmanager/manager.cpp soc/2011/sound/src/plugins/common/soundmanager/psentity.cpp soc/2011/sound/src/plugins/common/soundmanager/pssoundsector.cpp Modified: soc/2011/sound/src/plugins/common/soundmanager/manager.cpp =================================================================== --- soc/2011/sound/src/plugins/common/soundmanager/manager.cpp 2011-06-14 19:07:15 UTC (rev 7415) +++ soc/2011/sound/src/plugins/common/soundmanager/manager.cpp 2011-06-14 23:36:35 UTC (rev 7416) @@ -258,12 +258,12 @@ void SoundSystemManager::UpdateSound() { float vol; - csHash<SoundHandle*, csString>::GlobalIterator handleIter(soundHandles.GetIterator()); SoundHandle* sh; + csArray<SoundHandle*> handles = soundHandles.GetAll(); - while(handleIter.HasNext()) + for(int i = 0; i < handles.GetSize(); i++) { - sh = handleIter.Next(); + sh = handles[i]; if(sh->sndstream->GetPauseState() == CS_SNDSYS_STREAM_PAUSED && sh->GetAutoRemove() == true) Modified: soc/2011/sound/src/plugins/common/soundmanager/psentity.cpp =================================================================== --- soc/2011/sound/src/plugins/common/soundmanager/psentity.cpp 2011-06-14 19:07:15 UTC (rev 7415) +++ soc/2011/sound/src/plugins/common/soundmanager/psentity.cpp 2011-06-14 23:36:35 UTC (rev 7416) @@ -104,7 +104,7 @@ sp = statePar.Get(state, 0); - if(sp == 0) + if(sp != 0) { return false; } Modified: soc/2011/sound/src/plugins/common/soundmanager/pssoundsector.cpp =================================================================== --- soc/2011/sound/src/plugins/common/soundmanager/pssoundsector.cpp 2011-06-14 19:07:15 UTC (rev 7415) +++ soc/2011/sound/src/plugins/common/soundmanager/pssoundsector.cpp 2011-06-14 23:36:35 UTC (rev 7416) @@ -411,14 +411,21 @@ continue; } meshName = mesh->QueryObject()->GetName(); - factoryName = mesh->GetFactory()->QueryObject()->GetName(); + // check if the factory is defined for this mesh + iMeshFactoryWrapper* mfw = mesh->GetFactory(); + if(mfw == 0) + { + return; + } + factoryName = mfw->QueryObject()->GetName(); + // first it look in the meshes and factories of this sector - if((entity = meshes.Get(meshName, 0)) == 0) + if((entity = meshes.Get(meshName, 0)) != 0) { UpdateEntityValues(ctrl, entity, mesh); } - else if((entity = factories.Get(factoryName, 0)) == 0) + else if((entity = factories.Get(factoryName, 0)) != 0) { UpdateEntityValues(ctrl, entity, mesh); } @@ -426,11 +433,11 @@ // nothing found here: look in the commonSector else if(commonSector != 0) { - if((entity = commonSector->meshes.Get(meshName, 0)) == 0) + if((entity = commonSector->meshes.Get(meshName, 0)) != 0) { UpdateEntityValues(ctrl, entity, mesh); } - else if((entity = commonSector->factories.Get(factoryName, 0)) == 0) + else if((entity = commonSector->factories.Get(factoryName, 0)) != 0) { UpdateEntityValues(ctrl, entity, mesh); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |