Decompile fn_06589 (ItemInfo::Refine)

Batch #1445 by ragnarok-clanker: 0 byte-identical, 1 confirmed by peer review.

- fn_06589 ItemInfo::Refine: logic confirmed by peer review

Reviewed-by: ragnarok-clanker
This commit is contained in:
ragnarok-clanker 2026-10-28 12:58:47 +00:00
commit 3d1d975150
2 changed files with 18 additions and 1 deletions

View file

@ -51,6 +51,7 @@ struct alignas(8) ItemInfo {
bool IsForgeMaterial() const;
bool IsElementalStone() const;
bool IsAboveItemId600() const;
int Refine(char* output, int& capacity, unsigned char consume) const;
/* 0000 */ std::uint32_t unknown_0000[4];
/* 0010 */ std::int32_t quantity;
/* 0014 */ std::uint32_t unknown_0014[2];

View file

@ -1,5 +1,6 @@
#include "Contents/Items/ItemInfo.h"
#include "Contents/Items/ItemNaming.h"
#include "Utility/Text/FormatString.h"
#include "Contents/MessageTable.h"
#include "Contents/PlayerNameDictionary.h"
@ -394,7 +395,6 @@ struct ItemNamingContext : public ItemNaming {
int Element(const ItemInfo& item, char* output, int& capacity, unsigned char consume) const;
int Star(const ItemInfo& item, char* output, int& capacity, unsigned char consume) const;
int Apprentice(const ItemInfo& item, char* output, int& capacity, unsigned char consume) const;
int Refine(const ItemInfo& item, char* output, int& capacity, unsigned char consume) const;
std::uint32_t CardColor(const ItemInfo& item, int slot) const;
};
@ -478,3 +478,19 @@ int ItemNamingContext::Apprentice(const ItemInfo& item, char* output, int& capac
}
// OFFSET: 0x006D70A0
// OFFSET: 0x006D70A0
// FUNCTION: fn_06589
int ItemInfo::Refine(char* output, int& capacity, unsigned char consume) const {
const int bytes = StringFormat(output, capacity, static_cast<std::size_t>(-1), "+%d ", this->unknown_0060);
if (bytes <= 0) {
return 0;
}
if (consume) {
capacity -= bytes;
}
return bytes;
}