From 6ebf2cf29b2db69cc86e8aab75890fd1ec26f29d Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Tue, 10 Nov 2026 10:44:06 +0000 Subject: [PATCH] Decompile 2 functions in Source/Contents/Effects/MonsterSkillEffects.cpp Batch #15852 by youko: 0 byte-identical, 2 confirmed by peer review. - fn_07190 CylinderSlice::ComputePoints: logic confirmed by peer review - fn_07168 CTunaPartyEffect::OnProcess: logic confirmed by peer review Peer-reviewed-by: ragnarok-clanker, eAthena, Yommy Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). --- .../Contents/Effects/MonsterSkillEffects.cpp | 42 +++++++++---------- 1 file changed, 19 insertions(+), 23 deletions(-) diff --git a/Source/Contents/Effects/MonsterSkillEffects.cpp b/Source/Contents/Effects/MonsterSkillEffects.cpp index 4bd513c6d..20a0594e3 100644 --- a/Source/Contents/Effects/MonsterSkillEffects.cpp +++ b/Source/Contents/Effects/MonsterSkillEffects.cpp @@ -4094,14 +4094,14 @@ void CTunaPartyEffect::OnProcess() { CSpriteParticle* particle = AsSprite(*it); const float phase = particle->animationParameter + 0.05f; particle->animationParameter = phase; - const float cosine = std::cos(phase) * 10.0f; - const float sine = std::sin(phase) * 10.0f; + const float cosine = ClientCos(phase) * 10.0f; + const float sine = ClientSin(phase) * 10.0f; particle->position.y = this->position[1] - 10.0f; particle->position.x = this->position[0] + sine; particle->position.z = this->position[2] + cosine; float angle = phase / 3.141592f * 180.0f; if (angle > 360.0f) { - angle = std::fmod(angle, 360.0f); + angle -= static_cast(static_cast(angle / 360.0f) * 360); } angle -= static_cast(g_modeMgr.GetGameMode())->camera->camera.yaw; if (angle < 0.0f) { @@ -4470,26 +4470,22 @@ struct CylinderSlice { // OFFSET: 0x0070F800 // FUNCTION: fn_07190 __declspec(noinline) vector3d* CylinderSlice::ComputePoints(vector3d points[2], double angle) { - const float radians = static_cast(angle); - const double radiansAsDouble = static_cast(radians); - const float sine = static_cast(std::sin(radiansAsDouble)); - const float cosine = static_cast(std::cos(radiansAsDouble)); - const float sineForHeight = static_cast(std::sin(radiansAsDouble)); - const float pitch = static_cast(this->pitch); - const double pitchAsDouble = static_cast(pitch); - const float cosinePitchForZ = static_cast(std::cos(pitchAsDouble)); - const double heightAlongZ = static_cast(cosinePitchForZ) * this->height; - const float sinePitch = static_cast(std::sin(pitchAsDouble)); - const float cosinePitchForX = static_cast(std::cos(pitchAsDouble)); - const double heightAlongX = static_cast(cosinePitchForX) * this->height; - const float cosineForHeight = static_cast(std::cos(radiansAsDouble)); - - points[0].x = static_cast(static_cast(cosine) * this->radius); - points[0].y = 0.0f; - points[0].z = static_cast(static_cast(sine) * this->radius); - points[1].x = static_cast(static_cast(cosineForHeight) * heightAlongX) + points[0].x; - points[1].y = static_cast(-static_cast(sinePitch) * this->height) + 0.0f; - points[1].z = static_cast(static_cast(sineForHeight) * heightAlongZ) + points[0].z; + const float baseZ = static_cast(ClientSin(static_cast(angle)) * this->radius); + const float baseX = static_cast(ClientCos(static_cast(angle)) * this->radius); + vector3d result[2]; + result[0].x = baseX; + result[0].y = 0.0f; + result[0].z = baseZ; + const float offsetZ = + static_cast(ClientSin(static_cast(angle)) * (this->height * ClientCos(static_cast(this->pitch)))); + const float offsetY = static_cast(this->height * -ClientSin(static_cast(this->pitch))); + const float offsetX = + static_cast(ClientCos(static_cast(this->pitch)) * this->height * ClientCos(static_cast(angle))); + result[1].x = offsetX + baseX; + result[1].y = offsetY + 0.0f; + result[1].z = offsetZ + baseZ; + points[0] = result[0]; + points[1] = result[1]; return points; }