@@ -94,16 +94,16 @@ void CParticleManager::PlayEffect(int effect_id, int alist_id)
94
94
return ; // ERROR
95
95
pa->lock ();
96
96
// Step through all the actions in the action list.
97
- for (PAVecIt it = pa-> begin (); it != pa-> end (); ++it )
97
+ for (auto & it : *pa )
98
98
{
99
- VERIFY ((*it) );
100
- switch ((*it) ->type )
99
+ VERIFY (it );
100
+ switch (it ->type )
101
101
{
102
- case PASourceID: static_cast <PASource*>(* it)->m_Flags .set (PASource::flSilent, false );
102
+ case PASourceID: static_cast <PASource*>(it)->m_Flags .set (PASource::flSilent, false );
103
103
break ;
104
- case PAExplosionID: static_cast <PAExplosion*>(* it)->age = 0 .f ;
104
+ case PAExplosionID: static_cast <PAExplosion*>(it)->age = 0 .f ;
105
105
break ;
106
- case PATurbulenceID: static_cast <PATurbulence*>(* it)->age = 0 .f ;
106
+ case PATurbulenceID: static_cast <PATurbulence*>(it)->age = 0 .f ;
107
107
break ;
108
108
}
109
109
}
@@ -120,11 +120,11 @@ void CParticleManager::StopEffect(int effect_id, int alist_id, bool deffered)
120
120
pa->lock ();
121
121
122
122
// Step through all the actions in the action list.
123
- for (PAVecIt it = pa-> begin (); it != pa-> end (); ++it )
123
+ for (auto & it : *pa )
124
124
{
125
- switch ((*it) ->type )
125
+ switch (it ->type )
126
126
{
127
- case PASourceID: static_cast <PASource*>(* it)->m_Flags .set (PASource::flSilent, true );
127
+ case PASourceID: static_cast <PASource*>(it)->m_Flags .set (PASource::flSilent, true );
128
128
break ;
129
129
}
130
130
}
@@ -150,10 +150,10 @@ void CParticleManager::Update(int effect_id, int alist_id, float dt)
150
150
151
151
// Step through all the actions in the action list.
152
152
float kill_old_time = 1 .0f ;
153
- for (PAVecIt it = pa-> begin (); it != pa-> end (); ++it )
153
+ for (auto & it : *pa )
154
154
{
155
- VERIFY ((*it) );
156
- (*it) ->Execute (pe, dt, kill_old_time);
155
+ VERIFY (it );
156
+ it ->Execute (pe, dt, kill_old_time);
157
157
}
158
158
pa->unlock ();
159
159
}
@@ -177,16 +177,16 @@ void CParticleManager::Transform(int alist_id, const Fmatrix& full, const Fvecto
177
177
mT .translate (full.c );
178
178
179
179
// Step through all the actions in the action list.
180
- for (PAVecIt it = pa-> begin (); it != pa-> end (); ++it )
180
+ for (auto & it : *pa )
181
181
{
182
- bool r = (*it) ->m_Flags .is (ParticleAction::ALLOW_ROTATE);
182
+ bool r = it ->m_Flags .is (ParticleAction::ALLOW_ROTATE);
183
183
const Fmatrix& m = r ? full : mT ;
184
- (*it) ->Transform (m);
185
- switch ((*it) ->type )
184
+ it ->Transform (m);
185
+ switch (it ->type )
186
186
{
187
187
case PASourceID:
188
- static_cast <PASource*>(* it)->parent_vel =
189
- pVector (vel.x , vel.y , vel.z ) * static_cast <PASource*>(* it)->parent_motion ;
188
+ static_cast <PASource*>(it)->parent_vel =
189
+ pVector (vel.x , vel.y , vel.z ) * static_cast <PASource*>(it)->parent_motion ;
190
190
break ;
191
191
}
192
192
}
@@ -328,7 +328,7 @@ void CParticleManager::SaveActions(int alist_id, IWriter& W)
328
328
VERIFY (pa);
329
329
pa->lock ();
330
330
W.w_u32 (pa->size ());
331
- for (PAVecIt it = pa-> begin (); it != pa-> end (); ++it )
332
- (*it) ->Save (W);
331
+ for (auto & it : *pa )
332
+ it ->Save (W);
333
333
pa->unlock ();
334
334
}
0 commit comments