diff --git a/Source/Contents/Effects/Bash.cpp b/Source/Contents/Effects/Bash.cpp index e0203e99..2c80fd02 100644 --- a/Source/Contents/Effects/Bash.cpp +++ b/Source/Contents/Effects/Bash.cpp @@ -103,7 +103,8 @@ bool CBash::Slot06() { // OFFSET: 0x00B42720 // FUNCTION: fn_18872 void CBash::Slot03() { - for (CParticle* particle : this->rays) { + for (auto it = this->rays.begin(); it != this->rays.end(); ++it) { + CParticle* particle = *it; float* values = &particle->unknown_0054; const int fadeFrame = static_cast(values[1]); const int limit = static_cast(values[2]); @@ -122,7 +123,8 @@ void CBash::Slot03() { particle->alpha = std::min(alpha, limit); } - for (CParticle* particle : this->sparks) { + for (auto it = this->sparks.begin(); it != this->sparks.end(); ++it) { + CParticle* particle = *it; float* values = &particle->unknown_0054; const int fadeFrame = static_cast(values[8]); const int limit = static_cast(values[6]); @@ -151,7 +153,8 @@ void CBash::Slot03() { // OFFSET: 0x00B42C40 // FUNCTION: fn_18873 void CBash::Slot04() { - for (CParticle* particle : this->rays) { + for (auto it = this->rays.begin(); it != this->rays.end(); ++it) { + CParticle* particle = *it; const int angle = static_cast(*reinterpret_cast(&particle->unknown_00C4)); const float scale = particle->scale; const float cosine = g_cosTable[angle]; @@ -198,7 +201,8 @@ void CBash::Slot04() { g_renderer->queues.Submit(&primitive, static_cast(particle->flags), g_renderer->fog.supported != 0, g_depthStart, g_depthEnd); } - for (CParticle* particle : this->sparks) { + for (auto it = this->sparks.begin(); it != this->sparks.end(); ++it) { + CParticle* particle = *it; const float* values = &particle->unknown_0054; const float angle = values[0]; const float width = values[3]; diff --git a/Source/Contents/Effects/ElectricEffect.cpp b/Source/Contents/Effects/ElectricEffect.cpp index 93043221..e86b9f4d 100644 --- a/Source/Contents/Effects/ElectricEffect.cpp +++ b/Source/Contents/Effects/ElectricEffect.cpp @@ -187,7 +187,8 @@ void CElectricEffect::Slot03() { // OFFSET: 0x00B4F930 // FUNCTION: fn_19007 void CElectricEffect::Slot04() { - for (CParticle* bolt : this->bolts) { + for (auto it = this->bolts.begin(); it != this->bolts.end(); ++it) { + CParticle* bolt = *it; if (bolt && static_cast(bolt->unknown_000C - 1) <= 17 && bolt->unknown_0008 > 0) { const int frame = bolt->unknown_000C; const int alpha = bolt->alpha; diff --git a/Source/Contents/Effects/MeteorEffect.cpp b/Source/Contents/Effects/MeteorEffect.cpp index f710711f..f8cb5bf9 100644 --- a/Source/Contents/Effects/MeteorEffect.cpp +++ b/Source/Contents/Effects/MeteorEffect.cpp @@ -132,7 +132,8 @@ void CMeteorEffect::Slot03() { // OFFSET: 0x00707CA0 // FUNCTION: fn_07059 void CMeteorEffect::Slot04() { - for (CParticle* particle : this->unknown_00CC) { + for (auto it = this->unknown_00CC.begin(); it != this->unknown_00CC.end(); ++it) { + CParticle* particle = *it; if ((particle->life == 0.0f || particle->life * 60.0f > static_cast(particle->unknown_00E8)) && particle) { static_cast(particle)->sub_B40F30(0); } diff --git a/Source/Contents/Effects/RectUpEffect.cpp b/Source/Contents/Effects/RectUpEffect.cpp index f5f0999a..c73291e4 100644 --- a/Source/Contents/Effects/RectUpEffect.cpp +++ b/Source/Contents/Effects/RectUpEffect.cpp @@ -38,7 +38,7 @@ void CRectUpEffect::Slot03() { particle->position.y = this->position[1] + particle->unknown_00D4; particle->position.z = this->position[2] + particle->unknown_00D8; - int& phase = *reinterpret_cast(particle->unknown_0050); + int& phase = particle->unknown_0050; phase += phase + 1 < 360 ? 1 : -359; if (particle->unknown_00E8 > this->unknown_00E4) { particle->alpha = std::max(particle->alpha - 2, 0);