Skip to content

Commit 8949dd2

Browse files
committed
Tweak CarDamageParticles.cpp
* Correct includes * Use range-based for
1 parent d0323b3 commit 8949dd2

File tree

1 file changed

+8
-14
lines changed

1 file changed

+8
-14
lines changed

src/xrGame/CarDamageParticles.cpp

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
#include "stdafx.h"
2-
#include "cardamageparticles.h"
2+
#include "CarDamageParticles.h"
33
#ifdef DEBUG
44

55
#include "PHDebug.h"
66
#endif
77
#include "alife_space.h"
8-
#include "hit.h"
8+
#include "Hit.h"
99
#include "PHDestroyable.h"
1010
#include "Car.h"
1111
#include "Include/xrRender/Kinematics.h"
@@ -46,38 +46,32 @@ void CCarDamageParticles::Init(CCar* car)
4646
void CCarDamageParticles::Play1(CCar* car)
4747
{
4848
if (*m_car_damage_particles1)
49-
{
50-
auto i = bones1.begin(), e = bones1.end();
51-
for (; e != i; ++i)
52-
car->StartParticles(m_car_damage_particles1, *i, Fvector().set(0, 1, 0), car->ID());
53-
}
49+
for (auto& bone : bones1)
50+
car->StartParticles(m_car_damage_particles1, bone, Fvector().set(0, 1, 0), car->ID());
5451
}
5552

5653
void CCarDamageParticles::Play2(CCar* car)
5754
{
5855
VERIFY(!physics_world()->Processing());
5956
if (*m_car_damage_particles2)
60-
{
61-
auto i = bones2.begin(), e = bones2.end();
62-
for (; e != i; ++i)
63-
car->StartParticles(m_car_damage_particles2, *i, Fvector().set(0, 1, 0), car->ID());
64-
}
57+
for (auto& bone : bones2)
58+
car->StartParticles(m_car_damage_particles2, bone, Fvector().set(0, 1, 0), car->ID());
6559
}
6660

6761
/***** added by Ray Twitty (aka Shadows) START *****/
6862
// функции для выключения партиклов дыма
6963
void CCarDamageParticles::Stop1(CCar* car)
7064
{
7165
if(*m_car_damage_particles1)
72-
for (auto bone : bones1)
66+
for (auto& bone : bones1)
7367
car->StopParticles(car->ID(), bone, false);
7468
}
7569

7670
void CCarDamageParticles::Stop2(CCar* car)
7771
{
7872
VERIFY(!physics_world()->Processing());
7973
if(*m_car_damage_particles2)
80-
for (auto bone : bones2)
74+
for (auto& bone : bones2)
8175
car->StopParticles(car->ID(), bone, false);
8276
}
8377
/***** added by Ray Twitty (aka Shadows) END *****/

0 commit comments

Comments
 (0)