diff --git a/Source/Contents/Effects/HealEffect.cpp b/Source/Contents/Effects/HealEffect.cpp index 42fa4ea36..8a8abd5dc 100644 --- a/Source/Contents/Effects/HealEffect.cpp +++ b/Source/Contents/Effects/HealEffect.cpp @@ -14,7 +14,7 @@ // OFFSET: 0x00B67310 // FUNCTION: fn_19065 -CHealEffect::CHealEffect() : CEffect(-1), columnEdge{}, coneEdge{} { +CHealEffect::CHealEffect() : CEffect(-1) { this->spawnTick = 0; } @@ -254,31 +254,19 @@ void CHealEffect::UpdateParticleVertices(CParticle* particle) { } CGameMode* gameMode = static_cast(g_modeMgr.GetGameMode()); - if (std::string(gameMode->mapName) == "ecl_fild01.rsw") { - if (particle->alpha > 100) { - particle->alpha = 100; - } + if (std::string(gameMode->mapName) == "ecl_fild01.rsw" && particle->alpha > 100) { + particle->alpha = 100; } const float scale = particle->scale; - vector3d points[4] = {}; + EffectPoint points[4]; const int angle = particle->angleParameter; - points[0].x = scale * g_cosTable[angle % 360]; - points[0].y = 0.0f; - points[0].z = scale * g_sinTable[angle % 360]; - - points[1].x = scale * g_cosTable[(angle + 90) % 360]; - points[1].y = 0.0f; - points[1].z = scale * g_sinTable[(angle + 90) % 360]; - - points[2].x = scale * g_cosTable[(angle + 180) % 360]; - points[2].y = 0.0f; - points[2].z = scale * g_sinTable[(angle + 180) % 360]; - - points[3].x = scale * g_cosTable[(angle + 270) % 360]; - points[3].y = 0.0f; - points[3].z = scale * g_sinTable[(angle + 270) % 360]; + for (int i = 0; i < 4; ++i) { + points[i].x = scale * g_cosTable[(angle + i * 90) % 360]; + points[i].y = 0.0f; + points[i].z = scale * g_sinTable[(angle + i * 90) % 360]; + } this->RotateToCamera(points); @@ -635,7 +623,7 @@ void CHealEffect::Render() { // OFFSET: 0x00B69E30 // FUNCTION: fn_19078 -void CHealEffect::RotateToCamera(vector3d* points) { +void CHealEffect::RotateToCamera(EffectPoint* points) { const int yaw = 360 - static_cast(static_cast(g_modeMgr.GetGameMode())->camera->camera.yaw); const int pitch = (450 - static_cast(static_cast(g_modeMgr.GetGameMode())->camera->camera.pitch)) % 360; diff --git a/Source/Contents/Effects/HealEffect.h b/Source/Contents/Effects/HealEffect.h index 38e6c932b..b79e4afde 100644 --- a/Source/Contents/Effects/HealEffect.h +++ b/Source/Contents/Effects/HealEffect.h @@ -2,6 +2,7 @@ #define RAGNAROK_SOURCE_CONTENTS_EFFECTS_HEALEFFECT_H #include "Contents/Effects/Effect.h" +#include "Contents/Effects/EffectPoint.h" #include "Utility/Math/Vector3d.h" #include @@ -25,10 +26,10 @@ public: void AddCone(int kind); void SpawnParticles(); void UpdateParticleVertices(CParticle* particle); - void RotateToCamera(vector3d* points); + void RotateToCamera(EffectPoint* points); - /* 00CC */ vector3d columnEdge[2]; - /* 00E4 */ vector3d coneEdge[2]; + /* 00CC */ EffectPoint columnEdge[2]; + /* 00E4 */ EffectPoint coneEdge[2]; /* 00FC */ int columnLifetime; /* 0100 */ int coneLifetime; /* 0104 */ int spawnTick;