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).
This commit is contained in:
parent
4c2855d1f5
commit
024af60e85
6 changed files with 176 additions and 176 deletions
|
|
@ -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<std::int64_t>(a) << 32 | static_cast<std::uint32_t>(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<std::int64_t>(e) << 32 | static_cast<std::uint32_t>(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<std::int64_t>(c) << 32 | static_cast<std::uint32_t>(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<std::int64_t>(e) << 32 | static_cast<std::uint32_t>(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<RagEffectState*>(sender);
|
||||
CRagEffect* const effect = static_cast<CRagEffect*>(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<CRagEffect*>(*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<CRagEffect*>(*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<RagEffectState*>(this->LaunchEffect(b, vector3d{0.0f, 0.0f, 0.0f}, 0.0f));
|
||||
if (!this->state.first) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if ((static_cast<std::int64_t>(c) << 32 | static_cast<std::uint32_t>(b)) > 0) {
|
||||
this->SendMsg(nullptr, 109, 0, b, c, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
|
||||
this->state.first = reinterpret_cast<RagEffectState*>(this->LaunchEffect(b, vector3d{0.0f, 0.0f, 0.0f}, 0.0f));
|
||||
if (!this->state.first) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
reinterpret_cast<CRagEffect*>(this->state.first)->SendMsg(nullptr, 80, 0, static_cast<std::int64_t>(e) << 32 | static_cast<std::uint32_t>(d), 0, 0, 0, 0);
|
||||
break;
|
||||
|
||||
case 86:
|
||||
if (!this->state.second) {
|
||||
this->state.second = reinterpret_cast<RagEffectState*>(this->LaunchEffect(b, vector3d{0.0f, 0.0f, 0.0f}, 0.0f));
|
||||
if (!this->state.second) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
reinterpret_cast<CRagEffect*>(this->state.second)->SendMsg(
|
||||
nullptr, 80, 0, static_cast<std::int64_t>(e) << 32 | static_cast<std::uint32_t>(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<CRagEffect*>(*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<CRenderObject*>(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<CRagEffect*>(*it);
|
||||
CRagEffect* const effect = *it;
|
||||
if (!effect) {
|
||||
this->state.effects.erase(it);
|
||||
} else if (effect->state.type == (static_cast<std::int64_t>(c) << 32 | static_cast<std::uint32_t>(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<CRenderObject*>(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<int>(effect->state.tag) == (static_cast<std::int64_t>(c) << 32 | static_cast<std::uint32_t>(b)) &&
|
||||
effect->state.type == (static_cast<std::int64_t>(e) << 32 | static_cast<std::uint32_t>(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<std::int64_t>(c) << 32 | static_cast<std::uint32_t>(b))) {
|
||||
effect->SendMsg(this, 143, 0, static_cast<std::int64_t>(c) << 32 | static_cast<std::uint32_t>(b), d, e, 0, 0);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 120:
|
||||
if (g_effectMgr->HasAllocator(b) == true && sender) {
|
||||
if (g_effectMgr->Has(static_cast<CRenderObject*>(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<CRagEffect*>(*it);
|
||||
CRagEffect* const effect = *it;
|
||||
if (!effect) {
|
||||
this->state.effects.erase(it);
|
||||
} else if (*reinterpret_cast<int*>(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<CRagEffect*>(*it);
|
||||
if (!effect) {
|
||||
this->state.effects.erase(it);
|
||||
} else if (effect->state.type == (static_cast<std::int64_t>(c) << 32 | static_cast<std::uint32_t>(b))) {
|
||||
effect->SendMsg(this, 143, 0, static_cast<std::int64_t>(c) << 32 | static_cast<std::uint32_t>(b), d, e, 0, 0);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 159:
|
||||
if (g_effectMgr->HasAllocator(d) && sender) {
|
||||
g_effectMgr->Retire(static_cast<CRenderObject*>(sender)->render.accountId, b, d);
|
||||
return;
|
||||
}
|
||||
|
||||
for (auto it = this->state.effects.begin(); it != this->state.effects.end(); ++it) {
|
||||
CRagEffect* const effect = reinterpret_cast<CRagEffect*>(*it);
|
||||
if (!effect) {
|
||||
this->state.effects.erase(it);
|
||||
} else if (static_cast<int>(effect->state.tag) == (static_cast<std::int64_t>(c) << 32 | static_cast<std::uint32_t>(b)) &&
|
||||
effect->state.type == (static_cast<std::int64_t>(e) << 32 | static_cast<std::uint32_t>(d))) {
|
||||
effect->SendMsg(this, 24, 0, 0, 0, 0, 0, 0);
|
||||
this->state.effects.erase(it);
|
||||
return;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue