Decompile 4 functions in Source/Contents/Items/ItemInfo.cpp, Source/Contents/Items/ItemInfo.h, ...

Batch #1336 by ragnarok-clanker: 0 byte-identical, 4 confirmed by peer review.

- fn_02473 CTexture::Touch: logic confirmed by peer review
- fn_06603 ItemInfo::IsApprenticeItem: logic confirmed by peer review
- fn_24179 CSession::IsReducedSkill: logic confirmed by peer review
- fn_23614 CSession::ConvertTooltipText: logic confirmed by peer review

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-28 10:35:18 +00:00
commit 22d7370193
6 changed files with 55 additions and 0 deletions

View file

@ -1,4 +1,8 @@
#include "Client/Session.h"
#include "Network/TextEncoding.h"
#include <cstring>
#include <windows.h>
// STATIC: 0x01732638
// GLOBAL: gl_24474
@ -25,3 +29,36 @@ void CSession::ClearItemSelection() {
}
}
}
// OFFSET: 0x00E3CFF0
// FUNCTION: fn_24179
bool CSession::IsReducedSkill(int skillId) const {
switch (skillId) {
case 4217:
case 4218:
case 4219:
case 4220:
case 4221:
case 4308:
case 4315:
return true;
default:
return false;
}
}
// OFFSET: 0x00DFF1F0
// FUNCTION: fn_23614
char* CSession::ConvertTooltipText(const char* source, char* output) const {
if (output != source) {
std::strcpy(output, source);
}
for (char* current = output; *current != '\0'; current = CharNextExA(static_cast<WORD>(g_textCodePage), current, 0)) {
if (*current == '_') {
*current = ' ';
}
}
return output;
}

View file

@ -114,6 +114,8 @@ public:
int GetPetHungryState(int hunger);
int GetPetEmotionNumber(int job, int action, int hungerLevel);
void ClearItemSelection();
bool IsReducedSkill(int skillId) const;
char* ConvertTooltipText(const char* source, char* output) const;
int MercSkillLevel(int skillId) const;
int SyncUnknown0E98();
};

View file

@ -204,3 +204,10 @@ bool ItemInfo::HasSpecialCard() const {
std::memcpy(&card, this->unknown_001C, sizeof(card));
return card == 254 || card == 255;
}
// OFFSET: 0x006D89D0
// FUNCTION: fn_06603
bool ItemInfo::IsApprenticeItem() const {
const unsigned id = static_cast<unsigned>(std::atoi(this->itemId.c_str()));
return id - 9001u <= 498u || id - 10000u <= 999u;
}

View file

@ -47,6 +47,7 @@ struct alignas(8) ItemInfo {
bool SetName(const char* name);
void SetItemId(int value);
bool HasSpecialCard() const;
bool IsApprenticeItem() const;
/* 0000 */ std::uint32_t unknown_0000[4];
/* 0010 */ std::int32_t quantity;
/* 0014 */ std::uint32_t unknown_0014[2];

View file

@ -34,6 +34,13 @@ std::uint32_t CTexture::Retain() {
return ++this->unknown_001C;
}
// OFFSET: 0x005724F0
// FUNCTION: fn_02473
std::uint32_t CTexture::Touch() {
this->unknown_0020 = timeGetTime();
return this->unknown_0020;
}
// OFFSET: 0x005724E0
// FUNCTION: fn_02472
std::uint32_t CTexture::Release() {

View file

@ -29,6 +29,7 @@ public:
void StretchTo(RenderPrimitivePool& pool, RenderQueues& queues, int x, int y, int width, int height, bool depthAlpha, float depthStart, float depthEnd);
std::uint32_t SetImageSize(std::uint32_t width, std::uint32_t height);
std::uint32_t Retain();
std::uint32_t Touch();
std::uint32_t Release();
int SetName(const char* name);