Decompile 3 functions in Source/Contents/Items/ItemInfo.cpp, Source/Contents/Items/ItemInfo.h
Batch #1368 by Yommy: 0 byte-identical, 3 confirmed by peer review. - fn_06601 ItemInfo::IsForgeMaterial: logic confirmed by peer review - fn_06604 ItemInfo::IsElementalStone: logic confirmed by peer review - fn_06605 ItemInfo::IsAboveItemId600: logic confirmed by peer review Reviewed-by: ragnarok-clanker
This commit is contained in:
parent
2bd9f525a3
commit
dc2307a00e
2 changed files with 44 additions and 0 deletions
|
|
@ -3,6 +3,18 @@
|
|||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
|
||||
// GLOBAL: gl_24720
|
||||
unsigned char g_digitCharacters[256] = {
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
|
||||
};
|
||||
|
||||
// OFFSET: 0x006D47E0
|
||||
// FUNCTION: fn_06562
|
||||
ItemInfo::ItemInfo() {
|
||||
|
|
@ -211,3 +223,31 @@ bool ItemInfo::IsApprenticeItem() const {
|
|||
const unsigned id = static_cast<unsigned>(std::atoi(this->itemId.c_str()));
|
||||
return id - 9001u <= 498u || id - 10000u <= 999u;
|
||||
}
|
||||
|
||||
// OFFSET: 0x006D8920
|
||||
// FUNCTION: fn_06601
|
||||
bool ItemInfo::IsForgeMaterial() const {
|
||||
return std::atoi(this->itemId.c_str()) == 1000 || this->IsElementalStone();
|
||||
}
|
||||
|
||||
// OFFSET: 0x006D8980
|
||||
|
||||
// OFFSET: 0x006D8A10
|
||||
// FUNCTION: fn_06604
|
||||
bool ItemInfo::IsElementalStone() const {
|
||||
switch (std::atoi(this->itemId.c_str())) {
|
||||
case 994:
|
||||
case 995:
|
||||
case 996:
|
||||
case 997:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// OFFSET: 0x006D8A50
|
||||
// FUNCTION: fn_06605
|
||||
bool ItemInfo::IsAboveItemId600() const {
|
||||
return std::atoi(this->itemId.c_str()) > 500 && std::atoi(this->itemId.c_str()) > 600;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -48,6 +48,9 @@ struct alignas(8) ItemInfo {
|
|||
void SetItemId(int value);
|
||||
bool HasSpecialCard() const;
|
||||
bool IsApprenticeItem() const;
|
||||
bool IsForgeMaterial() const;
|
||||
bool IsElementalStone() const;
|
||||
bool IsAboveItemId600() const;
|
||||
/* 0000 */ std::uint32_t unknown_0000[4];
|
||||
/* 0010 */ std::int32_t quantity;
|
||||
/* 0014 */ std::uint32_t unknown_0014[2];
|
||||
|
|
@ -76,6 +79,7 @@ struct alignas(8) ItemInfo {
|
|||
|
||||
ItemInfo LookupClientItem(const std::list<ItemInfo>& values, int id, unsigned char requireIdentified);
|
||||
ItemInfo LookupClientItemByIdentity(const std::list<ItemInfo>& values, std::uint32_t id);
|
||||
bool IsNumericText(const char* text);
|
||||
|
||||
#if defined(_WIN32) && !defined(_WIN64)
|
||||
static_assert(sizeof(ItemInfo) == 248);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue