rodecomp/Source/Client/SessionPredicates.cpp
ragnarok-clanker c932ad6499 Maintenance: Resubmission of 15134 without the 12 struct/type renames (their new names changed mangled symbols in 17 functions). Rena
Batch #15141 by ragnarok-clanker: no function's compiled code changes; checked with 537 compiled unit(s), including every includer of Source/Client/Input/LanguageTC.h, Source/Client/Mode/CGameMode.h, Source/Client/Mode/CLoginMode.h, Source/Client/Replay.h, Source/Client/Session.h, Source/Contents/AchievementMgr.h, Source/Contents/Actors/CharacterRender.h, Source/Contents/Actors/EffectActors.h, Source/Contents/Actors/GameActor.h, Source/Contents/Actors/Pc.h, Source/Contents/EnchantMgr.h, Source/Contents/GuildInfo.h, Source/Contents/Messenger/MessengerWindows.h, Source/Contents/Schedule/TimeScheduler.h, Source/Contents/Sound/SoundMgr.h, Source/Contents/SpriteLayerDrawing.h, Source/Contents/TableMng.h, Source/Contents/World/SkyBox.h, Source/UI/Chat/UINewChatWnd.h, Source/UI/Text/CreateLineInfo.h, Source/UI/UIGradeEnchantWnd.h, Source/UI/Window/UINewSelectCharWnd.h, Source/UI/Window/UINewSkillListWnd.h, Source/UI/Window/UIPetInfoWnd.h, Source/UI/Window/UIReplayRECControlWnd.h, Source/UI/Window/UIWindowMgr.h, Source/UI/Window/UIWindowMgr.inl.
2026-11-09 12:21:09 +00:00

121 lines
2.9 KiB
C++

#include "Client/Mode/CGameMode.h"
#include "Contents/Skills/SkillId.h"
#include "Client/Mode/ModeMgr.h"
#include "Client/Session.h"
#include "Contents/Actors/GameActor.h"
#include "Contents/Actors/Pc.h"
#include "Contents/World/World.h"
#include <cstdint>
// OFFSET: 0x00E1D6B0
// FUNCTION: fn_23850
int CSession::IsState291To303(int state) const {
switch (state) {
case SA_MONOCELL:
case SA_CLASSCHANGE:
case SA_SUMMONMONSTER:
case SA_REVERSEORCISH:
case SA_DEATH:
case SA_TAMINGMONSTER:
case SA_QUESTION:
case SA_GRAVITY:
case SA_LEVELUP:
case SA_INSTANTDEATH:
case SA_FULLRECOVERY:
case SA_COMA:
return 1;
default:
return 0;
}
}
// OFFSET: 0x00E1D700
// FUNCTION: fn_23851
bool CSession::HasTrackedAchievement(int id) const {
auto it = this->trackedAchievements.begin();
for (; it != this->trackedAchievements.end(); ++it) {
const SessionRecord6178 record = *it;
if (id == record.id) {
break;
}
}
return it != this->trackedAchievements.end();
}
// OFFSET: 0x00E1D850
// FUNCTION: fn_23852
int CSession::IsType0Or4(int type) const {
if (type == 0 || type == 4) {
return 1;
}
return 0;
}
// OFFSET: 0x00E1DD50
// FUNCTION: fn_23879
int CSession::IsMonsterActor(CGameActor* actor) const {
if (!actor) {
return 0;
}
const int job = actor->GetEffectiveJob(-1);
if ((job > 1000 && job < 3999) || (job >= 20021 && job <= 31999)) {
return 1;
}
if (actor->GetEffectiveJob(-1) >= 2114) {
actor->GetEffectiveJob(-1);
}
return 0;
}
// OFFSET: 0x00E1DDB0
// FUNCTION: fn_23880
int CSession::IsLocalPlayerAid(std::uint32_t aid) const {
if (aid == 0) {
return 0;
}
CPlayer* player = static_cast<CGameMode*>(g_modeMgr.GetGameMode())->scene->player;
if (player && aid == static_cast<std::uint32_t>(player->GetGdid())) {
return 1;
}
return 0;
}
// OFFSET: 0x00E1DDF0
// FUNCTION: fn_23881
bool CSession::IsHomunAid(std::uint32_t aid) const {
return aid != 0xFFFFFFFF && aid == *reinterpret_cast<const std::uint32_t*>(&this->spAndHomunculusStats[8]);
}
// OFFSET: 0x00E1DE10
// FUNCTION: fn_23882
bool CSession::IsMercenaryAid(std::uint32_t aid) const {
return aid != 0xFFFFFFFF && aid == *reinterpret_cast<const std::uint32_t*>(&this->companionTargetState[8]);
}
// OFFSET: 0x00E1DE30
// FUNCTION: fn_23883
int CSession::IsCompanionAid(std::uint32_t aid) const {
if (aid == 0xFFFFFFFF) {
return 0;
}
if (aid == *reinterpret_cast<const std::uint32_t*>(&this->spAndHomunculusStats[8]) ||
aid == *reinterpret_cast<const std::uint32_t*>(&this->companionTargetState[8]) || aid == this->petGid ||
aid == static_cast<std::uint32_t>(this->elementalGid)) {
return 1;
}
auto it = this->summonHp.find(aid);
if (it == this->summonHp.end() || it->second == -1) {
return 0;
}
return 1;
}
// OFFSET: 0x00E1DF00
// FUNCTION: fn_23885
bool CSession::IsPetAid(std::uint32_t aid) const {
return aid != 0xFFFFFFFF && aid == this->petGid;
}