File tree Expand file tree Collapse file tree 2 files changed +10
-14
lines changed
GeneralsMD/Code/GameEngine/Source/GameClient/System
Generals/Code/GameEngine/Source/GameClient/System Expand file tree Collapse file tree 2 files changed +10
-14
lines changed Original file line number Diff line number Diff line change @@ -3036,21 +3036,19 @@ void ParticleSystemManager::update( void )
3036
3036
m_lastLogicFrameUpdate = TheGameLogic->getFrame ();
3037
3037
3038
3038
// USE_PERF_TIMER(ParticleSystemManager)
3039
- ParticleSystem *sys;
3040
-
3041
- for (ParticleSystemListIt it = m_allParticleSystemList.begin (); it != m_allParticleSystemList.end ();)
3039
+ ParticleSystemListIt it = m_allParticleSystemList.begin ();
3040
+ while ( it != m_allParticleSystemList.end () )
3042
3041
{
3043
- sys = (*it);
3042
+ // TheSuperHackers @info Must increment the list iterator before potential element erasure from the list.
3043
+ ParticleSystem* sys = *it++;
3044
+
3044
3045
if (!sys) {
3045
3046
continue ;
3046
3047
}
3047
3048
3048
3049
if (sys->update (m_localPlayerIndex) == false )
3049
3050
{
3050
- ++it;
3051
3051
deleteInstance (sys);
3052
- } else {
3053
- ++it;
3054
3052
}
3055
3053
}
3056
3054
}
Original file line number Diff line number Diff line change @@ -2938,21 +2938,19 @@ void ParticleSystemManager::update( void )
2938
2938
m_lastLogicFrameUpdate = TheGameLogic->getFrame ();
2939
2939
2940
2940
// USE_PERF_TIMER(ParticleSystemManager)
2941
- ParticleSystem *sys;
2942
-
2943
- for (ParticleSystemListIt it = m_allParticleSystemList.begin (); it != m_allParticleSystemList.end ();)
2941
+ ParticleSystemListIt it = m_allParticleSystemList.begin ();
2942
+ while ( it != m_allParticleSystemList.end () )
2944
2943
{
2945
- sys = (*it);
2944
+ // TheSuperHackers @info Must increment the list iterator before potential element erasure from the list.
2945
+ ParticleSystem* sys = *it++;
2946
+
2946
2947
if (!sys) {
2947
2948
continue ;
2948
2949
}
2949
2950
2950
2951
if (sys->update (m_localPlayerIndex) == false )
2951
2952
{
2952
- ++it;
2953
2953
deleteInstance (sys);
2954
- } else {
2955
- ++it;
2956
2954
}
2957
2955
}
2958
2956
}
You can’t perform that action at this time.
0 commit comments