From 024af60e852f639eff62fcfb65d034335e6cf77a Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Fri, 6 Nov 2026 14:54:31 +0000 Subject: [PATCH] Decompile 5 functions in Source/Contents/Effects/EffectActor.h, Source/Contents/Effects/EffectActor.cpp, ... Batch #13047 by cremane: 0 byte-identical, 5 confirmed by peer review. - fn_21062 EffectActor::HasId: logic confirmed by peer review - fn_21069 EffectActor::LaunchEffect: logic confirmed by peer review - fn_21076 CGameActor::ShowPartyMemberEffect: logic confirmed by peer review - fn_21153 CGameActor::Slot15: logic confirmed by peer review - fn_21111 EffectActor::SendMsg: logic confirmed by peer review Peer-reviewed-by: gordaoprogramas, Toshiro, codeplay, SapitoSucio Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). --- Source/Contents/Actors/GameObject.cpp | 198 ++++++++--------- Source/Contents/Actors/RenderObject.cpp | 206 +++++++++--------- Source/Contents/Effects/EffectActor.cpp | 4 +- Source/Contents/Effects/EffectActor.h | 6 +- Source/Contents/Effects/EffectAttachments.cpp | 10 +- .../Contents/Effects/PartyMemberEffects.cpp | 2 +- 6 files changed, 213 insertions(+), 213 deletions(-) diff --git a/Source/Contents/Actors/GameObject.cpp b/Source/Contents/Actors/GameObject.cpp index dab6a48e..baf15dce 100644 --- a/Source/Contents/Actors/GameObject.cpp +++ b/Source/Contents/Actors/GameObject.cpp @@ -931,9 +931,75 @@ void CGameActor::ApplyPendingUnknown0408() { // FUNCTION: fn_21111 void EffectActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, int d, int e, int, int, int, int, int, int, int, int) { switch (static_cast(a) << 32 | static_cast(message)) { + case 24: + for (auto it = this->state.effects.begin(); it != this->state.effects.end(); ++it) { + (*it)->SendMsg(this, 24, 0, 0, 0, 0, 0, 0); + } + + this->state.effects.clear(); + break; + + case 86: + if (!this->state.second) { + this->state.second = this->LaunchEffect(b, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); + if (!this->state.second) { + return; + } + } + + this->state.second->SendMsg( + nullptr, 80, 0, static_cast(e) << 32 | static_cast(d), 0, 0, 0, 0 + ); + break; + + case 87: + if (this->state.second) { + const auto end = this->state.effects.end(); + const auto it = std::find(this->state.effects.begin(), end, this->state.second); + if (it != end) { + (*it)->SendMsg(this, 24, 0, 0, 0, 0, 0, 0); + this->state.effects.erase(it); + } + + this->state.second = nullptr; + } + break; + + case 85: + if (!this->state.first) { + this->state.first = this->LaunchEffect(b, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); + if (!this->state.first) { + return; + } + } + + if ((static_cast(c) << 32 | static_cast(b)) > 0) { + this->SendMsg(nullptr, 109, 0, b, c, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->state.first = this->LaunchEffect(b, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); + if (!this->state.first) { + return; + } + } + + this->state.first->SendMsg(nullptr, 80, 0, static_cast(e) << 32 | static_cast(d), 0, 0, 0, 0); + break; + + case 84: + if (this->state.first) { + const auto end = this->state.effects.end(); + const auto it = std::find(this->state.effects.begin(), end, this->state.first); + if (it != end) { + (*it)->SendMsg(this, 24, 0, 0, 0, 0, 0, 0); + this->state.effects.erase(it); + } + + this->state.first = nullptr; + } + break; + case 23: if (sender) { - RagEffectState* const effect = reinterpret_cast(sender); + CRagEffect* const effect = static_cast(sender); for (auto it = this->state.effects.begin(); it != this->state.effects.end(); ++it) { if (*it == effect) { this->state.effects.erase(it); @@ -950,72 +1016,6 @@ void EffectActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, } break; - case 24: - for (auto it = this->state.effects.begin(); it != this->state.effects.end(); ++it) { - reinterpret_cast(*it)->SendMsg(this, 24, 0, 0, 0, 0, 0, 0); - } - - this->state.effects.clear(); - break; - - case 84: - if (this->state.first) { - const auto end = this->state.effects.end(); - const auto it = std::find(this->state.effects.begin(), end, this->state.first); - if (it != end) { - reinterpret_cast(*it)->SendMsg(this, 24, 0, 0, 0, 0, 0, 0); - this->state.effects.erase(it); - } - - this->state.first = nullptr; - } - break; - - case 85: - if (!this->state.first) { - this->state.first = reinterpret_cast(this->LaunchEffect(b, vector3d{0.0f, 0.0f, 0.0f}, 0.0f)); - if (!this->state.first) { - return; - } - } - - if ((static_cast(c) << 32 | static_cast(b)) > 0) { - this->SendMsg(nullptr, 109, 0, b, c, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); - this->state.first = reinterpret_cast(this->LaunchEffect(b, vector3d{0.0f, 0.0f, 0.0f}, 0.0f)); - if (!this->state.first) { - return; - } - } - - reinterpret_cast(this->state.first)->SendMsg(nullptr, 80, 0, static_cast(e) << 32 | static_cast(d), 0, 0, 0, 0); - break; - - case 86: - if (!this->state.second) { - this->state.second = reinterpret_cast(this->LaunchEffect(b, vector3d{0.0f, 0.0f, 0.0f}, 0.0f)); - if (!this->state.second) { - return; - } - } - - reinterpret_cast(this->state.second)->SendMsg( - nullptr, 80, 0, static_cast(e) << 32 | static_cast(d), 0, 0, 0, 0 - ); - break; - - case 87: - if (this->state.second) { - const auto end = this->state.effects.end(); - const auto it = std::find(this->state.effects.begin(), end, this->state.second); - if (it != end) { - reinterpret_cast(*it)->SendMsg(this, 24, 0, 0, 0, 0, 0, 0); - this->state.effects.erase(it); - } - - this->state.second = nullptr; - } - break; - case 109: if (g_effectMgr->HasAllocator(b) && sender) { g_effectMgr->Retire(static_cast(sender)->render.accountId, b); @@ -1023,7 +1023,7 @@ void EffectActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, } for (auto it = this->state.effects.begin(); it != this->state.effects.end(); ++it) { - CRagEffect* const effect = reinterpret_cast(*it); + CRagEffect* const effect = *it; if (!effect) { this->state.effects.erase(it); } else if (effect->state.type == (static_cast(c) << 32 | static_cast(b))) { @@ -1034,6 +1034,36 @@ void EffectActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, } break; + case 159: + if (g_effectMgr->HasAllocator(d) && sender) { + g_effectMgr->Retire(static_cast(sender)->render.accountId, b, d); + return; + } + + for (auto it = this->state.effects.begin(); it != this->state.effects.end(); ++it) { + CRagEffect* const effect = *it; + if (!effect) { + this->state.effects.erase(it); + } else if (static_cast(effect->state.tag) == (static_cast(c) << 32 | static_cast(b)) && + effect->state.type == (static_cast(e) << 32 | static_cast(d))) { + effect->SendMsg(this, 24, 0, 0, 0, 0, 0, 0); + this->state.effects.erase(it); + return; + } + } + break; + + case 143: + for (auto it = this->state.effects.begin(); it != this->state.effects.end(); ++it) { + CRagEffect* const effect = *it; + if (!effect) { + this->state.effects.erase(it); + } else if (effect->state.type == (static_cast(c) << 32 | static_cast(b))) { + effect->SendMsg(this, 143, 0, static_cast(c) << 32 | static_cast(b), d, e, 0, 0); + } + } + break; + case 120: if (g_effectMgr->HasAllocator(b) == true && sender) { if (g_effectMgr->Has(static_cast(sender)->render.accountId, b) == true) { @@ -1043,7 +1073,7 @@ void EffectActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, } for (auto it = this->state.effects.begin(); it != this->state.effects.end(); ++it) { - CRagEffect* const effect = reinterpret_cast(*it); + CRagEffect* const effect = *it; if (!effect) { this->state.effects.erase(it); } else if (*reinterpret_cast(b) == effect->state.type) { @@ -1052,36 +1082,6 @@ void EffectActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, } } break; - - case 143: - for (auto it = this->state.effects.begin(); it != this->state.effects.end(); ++it) { - CRagEffect* const effect = reinterpret_cast(*it); - if (!effect) { - this->state.effects.erase(it); - } else if (effect->state.type == (static_cast(c) << 32 | static_cast(b))) { - effect->SendMsg(this, 143, 0, static_cast(c) << 32 | static_cast(b), d, e, 0, 0); - } - } - break; - - case 159: - if (g_effectMgr->HasAllocator(d) && sender) { - g_effectMgr->Retire(static_cast(sender)->render.accountId, b, d); - return; - } - - for (auto it = this->state.effects.begin(); it != this->state.effects.end(); ++it) { - CRagEffect* const effect = reinterpret_cast(*it); - if (!effect) { - this->state.effects.erase(it); - } else if (static_cast(effect->state.tag) == (static_cast(c) << 32 | static_cast(b)) && - effect->state.type == (static_cast(e) << 32 | static_cast(d))) { - effect->SendMsg(this, 24, 0, 0, 0, 0, 0, 0); - this->state.effects.erase(it); - return; - } - } - break; } } diff --git a/Source/Contents/Actors/RenderObject.cpp b/Source/Contents/Actors/RenderObject.cpp index 96279ed7..f6f90dbe 100644 --- a/Source/Contents/Actors/RenderObject.cpp +++ b/Source/Contents/Actors/RenderObject.cpp @@ -1262,9 +1262,9 @@ void CGameActor::Slot23(int, int) { } // INLINED -static bool HasEffectOfType(const std::list& effects, int type) { - for (RagEffectState* effect : effects) { - if (effect && effect->type == type) { +static bool HasEffectOfType(const std::list& effects, int type) { + for (CRagEffect* effect : effects) { + if (effect && effect->state.type == type) { return true; } } @@ -1312,19 +1312,38 @@ void CGameActor::Slot15(int state, int resetPosition) { } switch (state) { - case 0: - this->SetAction(action, 4, 0); - if (!IsObfuscatedMessage(this->render.accountId)) { - this->render.isMotionFinished = true; + case 0xd: + if (g_session.IsPlayerJobId(this->GetEffectiveJob(-1))) { + const std::int64_t weapon = this->Slot35(); + IsJobWeaponAllowed(this->GetEffectiveJob(-1), this->unknown_0260, weapon); + this->SetAction(action, 4, 1); + this->render.isMotionFreezed = true; + } else { + this->SetAction(16, 4, 1); + this->render.isMotionFreezed = true; } - this->Slot16(); break; - case 1: - if (this->unknown_0184 == 0) { - this->SetAction(action, 6, 0); + case 4: { + if (this->render.unknown_00C8 != 0 || this->render.unknown_00D8 != 0 || this->render.unknown_00DC != 0) { + return; + } + + CRenderObject* target; + if (this->hitTargetAid == g_session.m_aid) { + target = mode->scene->player; + } else { + target = mode->scene->GetGameActorByAID(this->hitTargetAid); + } + if (target) { + target->SendMsg(nullptr, 0x57, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + } + this->SetAction(action, 5, 1); + const int job = this->GetEffectiveJob(-1); + if (job != 0x8d && job != 0xe6) { + this->Slot16(); } - this->Slot17(); break; + } case 7: if (this->render.unknown_0070 == 6) { return; @@ -1365,27 +1384,19 @@ void CGameActor::Slot15(int state, int resetPosition) { this->render.isMotionFreezed = false; this->SetAction(action, 4, 1); break; - case 4: { - if (this->render.unknown_00C8 != 0 || this->render.unknown_00D8 != 0 || this->render.unknown_00DC != 0) { - return; - } - - CRenderObject* target; - if (this->hitTargetAid == g_session.m_aid) { - target = mode->scene->player; - } else { - target = mode->scene->GetGameActorByAID(this->hitTargetAid); - } - if (target) { - target->SendMsg(nullptr, 0x57, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); - } - this->SetAction(action, 5, 1); - const int job = this->GetEffectiveJob(-1); - if (job != 0x8d && job != 0xe6) { - this->Slot16(); + case 0: + this->SetAction(action, 4, 0); + if (!IsObfuscatedMessage(this->render.accountId)) { + this->render.isMotionFinished = true; } + this->Slot16(); + break; + case 1: + if (this->unknown_0184 == 0) { + this->SetAction(action, 6, 0); + } + this->Slot17(); break; - } case 5: this->unknown_0178 = 0; this->render.isMotionFreezed = false; @@ -1396,17 +1407,6 @@ void CGameActor::Slot15(int state, int resetPosition) { this->SetAction(action, 3, 1); this->Slot16(); break; - case 0xd: - if (g_session.IsPlayerJobId(this->GetEffectiveJob(-1))) { - const std::int64_t weapon = this->Slot35(); - IsJobWeaponAllowed(this->GetEffectiveJob(-1), this->unknown_0260, weapon); - this->SetAction(action, 4, 1); - this->render.isMotionFreezed = true; - } else { - this->SetAction(16, 4, 1); - this->render.isMotionFreezed = true; - } - break; case 0x10: this->render.unknown_00C2 = 10; this->SetFrameSequence(action, 1, 3, 0, 0, 1, 99999999, 1); @@ -1419,6 +1419,10 @@ void CGameActor::Slot15(int state, int resetPosition) { this->render.unknown_00C2 = 10; this->SetFrameSequence(action, 0, 0, action, 0, 1, 3000, 0); break; + case 0x1c: + this->render.unknown_00C2 = 10; + this->SetAnimationSequence(action, 0, action, 1, action, 2, action, 3, action, 4, 1, 1000, 0); + break; case 0x13: if (g_session.IsDoramJob(this->GetEffectiveJob(-1)) == true) { this->render.unknown_00C2 = 10; @@ -1445,26 +1449,41 @@ void CGameActor::Slot15(int state, int resetPosition) { this->SetFrameSequence(action, 0, 0, action, 0, 1, 2000, 0); this->LaunchEffect(0x1c1, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); break; + case 0x1e: + this->render.unknown_00C2 = 10; + this->SetFrameSequence(action, 1, 1, action, 1, 1, 2000, 0); + break; case 0x16: this->render.unknown_00C2 = 10; this->SetFrameSequence(action, 2, 2, action, 2, 1, 2000, 0); this->LaunchEffect(0x1c1, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); break; + case 0x21: + this->render.unknown_00C2 = 10; + this->SetFrameSequence(action, 2, 2, action, 2, 1, 1000, 0); + break; + case 0x1f: + this->render.unknown_00C2 = 5; + this->SetAnimationSequence(0x50, 3, 0x50, 5, 0x50, 7, 0x50, 8, 0x50, 2, 1, 500, 0); + break; case 0x17: this->render.unknown_00C2 = 10; this->SetFrameSequence(action, 3, 3, action, 3, 1, 2000, 0); this->LaunchEffect(0x1c1, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); break; + case 0x22: + this->render.unknown_00C2 = 10; + this->SetFrameSequence(action, 3, 3, action, 3, 1, 1000, 0); + break; + case 0x20: + this->render.unknown_00C2 = 5; + this->SetAnimationSequence(action, 4, action, 5, action, 6, action, 7, action, 2, 1, 500, 0); + break; case 0x18: this->render.unknown_00C2 = 10; this->SetFrameSequence(action, 4, 4, action, 4, 1, 2000, 0); this->LaunchEffect(0x1c1, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); break; - case 0x19: - this->render.unknown_00C2 = 10; - this->SetFrameSequence(action, 1, 1, action, 1, 1, 2000, 0); - this->LaunchEffect(0x1c1, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); - break; case 0x1a: { this->render.unknown_00C2 = 4; int frame0; @@ -1489,33 +1508,22 @@ void CGameActor::Slot15(int state, int resetPosition) { this->SetAnimationSequence(action, frame0, action, frame1, action, frame2, action, frame3, action, frame4, 1, 500, 0); break; } + case 0x19: + this->render.unknown_00C2 = 10; + this->SetFrameSequence(action, 1, 1, action, 1, 1, 2000, 0); + this->LaunchEffect(0x1c1, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); + break; case 0x1b: this->render.unknown_00C2 = 10; this->SetFrameSequence(action, 5, 5, action, 5, 1, 3000, 0); break; - case 0x1c: - this->render.unknown_00C2 = 10; - this->SetAnimationSequence(action, 0, action, 1, action, 2, action, 3, action, 4, 1, 1000, 0); + case 0x24: + this->render.unknown_00C2 = 6; + this->SetFrameSequence(action, 2, 5, action, 5, 1, 1000, 0); break; - case 0x1e: - this->render.unknown_00C2 = 10; - this->SetFrameSequence(action, 1, 1, action, 1, 1, 2000, 0); - break; - case 0x1f: - this->render.unknown_00C2 = 5; - this->SetAnimationSequence(0x50, 3, 0x50, 5, 0x50, 7, 0x50, 8, 0x50, 2, 1, 500, 0); - break; - case 0x20: - this->render.unknown_00C2 = 5; - this->SetAnimationSequence(action, 4, action, 5, action, 6, action, 7, action, 2, 1, 500, 0); - break; - case 0x21: - this->render.unknown_00C2 = 10; - this->SetFrameSequence(action, 2, 2, action, 2, 1, 1000, 0); - break; - case 0x22: - this->render.unknown_00C2 = 10; - this->SetFrameSequence(action, 3, 3, action, 3, 1, 1000, 0); + case 0x37: + this->render.unknown_00C2 = 6; + this->SetFrameSequence(action, 2, 4, action, 4, 1, 500, 0); break; case 0x38: this->render.isMotionFinished = false; @@ -1523,9 +1531,10 @@ void CGameActor::Slot15(int state, int resetPosition) { this->render.unknown_00C2 = 6; this->SetFrameSequence(action, 0, 1, action, 1, 1, 500, 0); break; - case 0x24: + case 0x39: + this->render.isMotionFinished = false; this->render.unknown_00C2 = 6; - this->SetFrameSequence(action, 2, 5, action, 5, 1, 1000, 0); + this->SetFrameSequence(action, 5, 5, action, 5, 1, 500, 0); break; case 0x25: { this->render.unknown_00C2 = 10; @@ -1546,11 +1555,6 @@ void CGameActor::Slot15(int state, int resetPosition) { } break; } - case 0x27: - case 0x30: - this->render.unknown_00C2 = 6; - this->SetFrameSequence(action, 4, 5, action, 5, 1, 500, 0); - break; case 0x28: this->render.unknown_00C2 = 6; this->SetFrameSequence(action, 0, 2, action, 2, 1, 500, 0); @@ -1599,6 +1603,11 @@ void CGameActor::Slot15(int state, int resetPosition) { this->render.unknown_00C2 = 6; this->SetFrameSequence(action, 0, 3, action, 3, 1, 9999999, 1); break; + case 0x27: + case 0x30: + this->render.unknown_00C2 = 6; + this->SetFrameSequence(action, 4, 5, action, 5, 1, 500, 0); + break; case 0x31: this->render.unknown_00C2 = 6; this->SetFrameSequence(action, 0, 7, action, 7, 1, 1000, 0); @@ -1613,21 +1622,6 @@ void CGameActor::Slot15(int state, int resetPosition) { this->SetAnimationSequence(action, 2, action, 3, action, 4, action, 4, action, 4, 1, 500, 0); this->render.isMotionFinished = false; break; - case 0x37: - this->render.unknown_00C2 = 6; - this->SetFrameSequence(action, 2, 4, action, 4, 1, 500, 0); - break; - case 0x39: - this->render.isMotionFinished = false; - this->render.unknown_00C2 = 6; - this->SetFrameSequence(action, 5, 5, action, 5, 1, 500, 0); - break; - case 0x3c: - case 0x3d: - case 0x42: - this->render.unknown_00C2 = 6; - this->SetFrameSequence(action, 0, 0, action, 0, 1, 500, 0); - break; case 0x3e: this->render.unknown_00C2 = 6; this->SetFrameSequence(action, 1, 7, action, 7, 1, 500, 0); @@ -1650,6 +1644,12 @@ void CGameActor::Slot15(int state, int resetPosition) { this->SetFrameSequence(action, 1, 4, action, 4, 1, 500, 0); this->render.isMotionFinished = false; break; + case 0x3c: + case 0x3d: + case 0x42: + this->render.unknown_00C2 = 6; + this->SetFrameSequence(action, 0, 0, action, 0, 1, 500, 0); + break; case 0x43: this->render.unknown_00C2 = 6; this->SetFrameSequence(action, 1, 5, action, 5, 1, 500, 0); @@ -1672,6 +1672,11 @@ void CGameActor::Slot15(int state, int resetPosition) { this->render.isMotionFinished = false; this->unknown_0378 = 6.0f; break; + case 0x4c: + this->render.unknown_00C2 = 6; + this->SetFrameSequence(action, 0, 7, action, 7, 1, 500, 0); + this->render.isMotionFinished = false; + break; case 0x47: this->render.unknown_00C2 = 6; this->SetFrameSequence(action, 4, 8, action, 8, 1, 500, 0); @@ -1688,21 +1693,16 @@ void CGameActor::Slot15(int state, int resetPosition) { this->render.isMotionFinished = false; this->unknown_0378 = 6.0f; break; - case 0x4b: - this->render.unknown_00C2 = 6; - this->SetFrameSequence(action, 2, 5, action, 5, 1, 500, 1); - this->render.isMotionFinished = false; - break; - case 0x4c: - this->render.unknown_00C2 = 6; - this->SetFrameSequence(action, 0, 7, action, 7, 1, 500, 0); - this->render.isMotionFinished = false; - break; case 0x4d: this->render.unknown_00C2 = 6; this->SetFrameSequence(action, 3, 7, action, 7, 1, 500, 0); this->render.isMotionFinished = false; break; + case 0x4b: + this->render.unknown_00C2 = 6; + this->SetFrameSequence(action, 2, 5, action, 5, 1, 500, 1); + this->render.isMotionFinished = false; + break; case 0x4e: this->render.unknown_00C2 = 6; this->SetFrameSequence(action, 1, 4, action, 4, 1, 500, 1); @@ -2251,8 +2251,8 @@ void CGameActor::ShowPartyMemberEffect(std::uint32_t accountId) { for (int index = 0; index < g_session.PartyCount(); ++index) { MessengerMember member = g_session.PartyAt(index); if (member.accountId == accountId) { - for (RagEffectState* effect : this->state.effects) { - if (effect && effect->type == 160) { + for (CRagEffect* effect : this->state.effects) { + if (effect && effect->state.type == 160) { return; } } diff --git a/Source/Contents/Effects/EffectActor.cpp b/Source/Contents/Effects/EffectActor.cpp index 22285551..d8ad3aa9 100644 --- a/Source/Contents/Effects/EffectActor.cpp +++ b/Source/Contents/Effects/EffectActor.cpp @@ -23,9 +23,9 @@ struct CAbleToMakeEffect : EffectActor { // FUNCTION: fn_20993 CAbleToMakeEffect::~CAbleToMakeEffect() { if (!this->state.effects.empty()) { - for (std::list::iterator it = this->state.effects.begin(); it != this->state.effects.end(); ++it) { + for (std::list::iterator it = this->state.effects.begin(); it != this->state.effects.end(); ++it) { if (*it) { - CRagEffect* effect = reinterpret_cast(*it); + CRagEffect* effect = *it; effect->SendMsg(this, 0x18, 0, 0, 0, 0, 0, 0); } } diff --git a/Source/Contents/Effects/EffectActor.h b/Source/Contents/Effects/EffectActor.h index 467665f6..7147fb6e 100644 --- a/Source/Contents/Effects/EffectActor.h +++ b/Source/Contents/Effects/EffectActor.h @@ -17,9 +17,9 @@ struct EffectActorState { /* 0138 */ int unknown_0138; /* 013C */ std::uint32_t unknown_013C; /* 0140 */ std::uint32_t unknown_0140; - /* 0144 */ std::list effects; - /* 014C */ RagEffectState* first; - /* 0150 */ RagEffectState* second; + /* 0144 */ std::list effects; + /* 014C */ CRagEffect* first; + /* 0150 */ CRagEffect* second; }; struct EffectActor : CRenderObject { diff --git a/Source/Contents/Effects/EffectAttachments.cpp b/Source/Contents/Effects/EffectAttachments.cpp index df3ece00..e5890522 100644 --- a/Source/Contents/Effects/EffectAttachments.cpp +++ b/Source/Contents/Effects/EffectAttachments.cpp @@ -1,11 +1,11 @@ #include "Contents/Effects/EffectActor.h" -#include "Contents/Effects/RagEffectState.h" +#include "Contents/Effects/RagEffect.h" // OFFSET: 0x00CADBE0 // FUNCTION: fn_21062 bool EffectActor::HasId(int id) const { - for (const RagEffectState* effect : this->state.effects) { - if (effect && effect->type == id) { + for (const CRagEffect* effect : this->state.effects) { + if (effect && effect->state.type == id) { return true; } } @@ -16,8 +16,8 @@ bool EffectActor::HasId(int id) const { // OFFSET: 0x00CADC40 // FUNCTION: fn_21064 bool EffectActor::Contains(const RagEffectState* effect) const { - for (const RagEffectState* current : this->state.effects) { - if (current == effect) { + for (const CRagEffect* current : this->state.effects) { + if (current == reinterpret_cast(effect)) { return true; } } diff --git a/Source/Contents/Effects/PartyMemberEffects.cpp b/Source/Contents/Effects/PartyMemberEffects.cpp index b581ee6d..1d793fe5 100644 --- a/Source/Contents/Effects/PartyMemberEffects.cpp +++ b/Source/Contents/Effects/PartyMemberEffects.cpp @@ -152,7 +152,7 @@ CRagEffect* EffectActor::LaunchEffect(int effectId, vector3d deltaPos, float rot effect->Init(this, effectId, deltaPos); static_cast(g_modeMgr.GetGameMode())->scene->objects.push_back(effect); - this->state.effects.push_back(&effect->state); + this->state.effects.push_back(effect); return effect; }