rodecomp/Source/Contents/SpriteRidingOffset.cpp
ragnarok-clanker fec919b88e Maintenance: Link-completeness fixes so the whole client links into one executable (all units in data/compile.json plus exe-only thir
Batch #13186 by ragnarok-clanker: forced by an admin (40 lower score(s), 206 changed function(s)); checked with 620 compiled unit(s), including every includer of Source/Archive/GPak.h, Source/Client/Mode/CGameMode.h, Source/Client/Mode/CLoginMode.h, Source/Client/Session.h, Source/Client/Stove/StoveMgr.h, Source/Client/Stove/StovePCSDK.h, Source/Client/Timer.h, Source/Contents/Actors/GameActor.h, Source/Contents/Actors/RenderObject.h, Source/Contents/CashEmotionMgr.h, Source/Contents/Configuration/ServiceOptions.h, Source/Contents/Skills/SkillTreeScript.h, Source/Render/DX9/D3DX9Runtime.h, Source/Resource/GifResource.h, Source/UI/AdventureGuide/UIAdventureGuide.h, Source/UI/Cooldowns/CooldownOwner.h, Source/UI/Edit/UIEditBoxEx.h, Source/UI/Lists/UIListBoxTemplate.h, Source/UI/Quest/UIRenewQuestUI.h, Source/UI/Rodex/UIRodexComposeWnd.h, Source/UI/Text/UITextViewerControl.h, Source/UI/UIBroadcastBalloon.h, Source/UI/UICaptchaRegisterWnd.h, Source/UI/UIMacroDetectorWnd.h, Source/UI/UIReputeWnd.h, Source/UI/Window/UIRegisterMgr.h, Source/UI/Window/UISecondCostumeWnd.h, Source/UI/Window/UISelCharForUServerWnd.h, Source/UI/Window/UIWindow.h, Source/UI/Window/UIWindowMgr.h, Source/Utility/EncryptedName.h.
2026-11-06 10:56:48 +00:00

38 lines
1.2 KiB
C++

#include "Contents/SpriteRidingOffset.h"
#include "Contents/EquipmentResourceMgr.h"
#include "Contents/Jobs/JobNames.h"
#include "Resource/ResourceMgr.h"
#include "Resource/Sprites/ActionResource.h"
// OFFSET: 0x00DDE340
// FUNCTION: fn_23394
std::string GetBodyActionResourceName(int job, int sex, int costumeJob, int costume) {
return g_equipmentResourceMgr->GetBodyResourceName(0, job, sex, costumeJob, costume);
}
// OFFSET: 0x00DAAC70
// FUNCTION: fn_22576
int SpriteRidingOffset(const ActionFrame* frame, unsigned animation, unsigned motion, int job, int sex, int costumeJob) {
if (!frame || !&frame->Cell(1)) {
return 0;
}
const std::string name = GetBodyActionResourceName(JobNames::BaseJob(job), sex, costumeJob, 0);
CActRes* action = static_cast<CActRes*>(ResourceMgr::Instance().Load(name));
if (!action) {
return 0;
}
const ActionFrame* baseFrame = &action->Frame(animation, motion);
if (!baseFrame || baseFrame->anchors.empty() || frame->anchors.empty()) {
return 0;
}
const ActionAnchor& base = baseFrame->anchors.front();
const ActionAnchor& riding = frame->anchors.front();
if (base.unknown_0008 != riding.unknown_0008) {
return 0;
}
return base.y - riding.y;
}