rodecomp/Source/Contents/Effects/EffectVisibility.cpp
ragnarok-clanker 17e7ed3071 Maintenance: [forced, user-approved] R3: remove invented EffectPrimitiveRenderContext and EffectVisibilityContext; delete EffectPrimi
Batch #10235 by ragnarok-clanker: forced by an admin (0 lower score(s), 5 changed function(s)); checked with 39 compiled unit(s), including every includer of Source/Contents/Effects/EffectPrim.h, Source/Contents/Effects/RagEffect.h, Source/Contents/Effects/EffectPrimitiveRendering.h, Source/Contents/Effects/EffectVisibility.h.
Deletes: Source/Contents/Effects/EffectPrimitiveRendering.h, Source/Contents/Effects/EffectVisibility.h
2026-11-03 10:26:33 +00:00

55 lines
1.5 KiB
C++

#include "Contents/Effects/EffectActor.h"
#include "Contents/Effects/RagEffect.h"
#include "Contents/Effects/RagEffectState.h"
#include "Contents/Configuration/ServiceOptions.h"
#include "Client/Mode/CGameMode.h"
#include "Client/Mode/ModeMgr.h"
#include "Client/Session.h"
#include "Contents/World/World.h"
// OFFSET: 0x00C734B0
// FUNCTION: fn_20327
bool CRagEffect::PartyEffectVisible() {
if (g_serviceOptions.Get(8) == 0 && this->state.forceRender == 0) {
return false;
}
if (this->state.type == 232) {
CWorld* scene = static_cast<CGameMode*>(g_modeMgr.GetGameMode())->scene;
const EffectActor* target = static_cast<const EffectActor*>(scene->GetGameActorByAidIncludeMe(static_cast<std::uint32_t>(this->state.deltaPos[1])));
if (!target) {
return false;
}
if (target->render.unknown_00A8 != 0 && target->render.accountId != g_session.m_aid) {
if (!g_session.IsPvpMap() || !g_session.IsPartyMember(target->render.accountId, true)) {
if (!target->EffectVisible()) {
return false;
}
}
}
}
const EffectActor* actor = this->state.parent;
if (!actor) {
return false;
}
if (actor->render.unknown_00A8 == 0) {
return true;
}
if (this->state.unknown_11CA0 == 0) {
if (actor->render.accountId == g_session.m_aid) {
return true;
}
if (g_session.IsPvpMap() && g_session.IsPartyMember(actor->render.accountId, true)) {
return true;
}
}
return actor->EffectVisible();
}