Decompile fn_24218 (CSession::ReadReplayShortcuts)

Batch #7328 by eAthena: 0 byte-identical, 1 confirmed by peer review.

- fn_24218 CSession::ReadReplayShortcuts: logic confirmed by peer review

Peer-reviewed-by: meitogi, gordaoprogramas, aDw
Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes).
This commit is contained in:
ragnarok-clanker 2026-10-31 07:33:15 +00:00
commit ed40e0d3bd
2 changed files with 41 additions and 0 deletions

View file

@ -912,6 +912,46 @@ std::uint32_t CSession::ReadReplayQuests(const std::vector<unsigned char>& data)
return offset;
}
// OFFSET: 0x00E482B0
// FUNCTION: fn_24218
std::uint32_t CSession::ReadReplayShortcuts(const std::vector<unsigned char>& data) {
if (data.begin() == data.end()) {
return 0xFFFFFFFF;
}
std::uint32_t offset = 6;
ReplayBlockHeader header{};
std::memcpy(&header, data.data(), sizeof(header));
if (header.id != 7000) {
return 0xFFFFFFFF;
}
while (offset < data.size()) {
header = {};
std::memcpy(&header, data.data() + offset, sizeof(header));
offset += 6;
switch (header.id) {
case 7001:
return offset;
case 7100:
g_session.ClearShortcutSlots();
std::memcpy(this->m_shortcutSlots, data.data() + offset, header.bytes);
offset += header.bytes;
break;
case 7101:
g_session.ClearSlots06EB();
std::memcpy(&this->unknown_06EB, data.data() + offset, header.bytes);
offset += header.bytes;
break;
default:
offset += header.bytes;
break;
}
}
return offset;
}
// OFFSET: 0x00E488C0
// FUNCTION: fn_24221
void CSession::UpdateBodyStyle(int job, int style, int renderJob) {