diff --git a/Source/Client/Session.h b/Source/Client/Session.h index 6af64565..5929c2e8 100644 --- a/Source/Client/Session.h +++ b/Source/Client/Session.h @@ -261,7 +261,9 @@ public: /* 619C */ unsigned char unknown_619C[0x1C]; /* 61B8 */ ITEM_INFO unknown_61B8[10]; /* 6B68 */ ITEM_INFO unknown_6B68[10]; - /* 7518 */ unsigned char unknown_7518[0x9C8]; + /* 7518 */ unsigned char unknown_7518[0x9C0]; + /* 7ED8 */ int m_swapEquipmentMode = 0; + /* 7EDC */ unsigned char unknown_7EDC[4]; /* 7EE0 */ std::map m_robeAlpha; /* 7EE8 */ unsigned char unknown_7EE8[4]; /* 7EEC */ int m_maxLevel; @@ -676,6 +678,7 @@ static_assert(offsetof(CSession, unknown_5C68) == 0x5C68); static_assert(offsetof(CSession, unknown_6140) == 0x6140); static_assert(offsetof(CSession, unknown_6144) == 0x6144); static_assert(offsetof(CSession, unknown_616C) == 0x616C); +static_assert(offsetof(CSession, m_swapEquipmentMode) == 0x7ED8); static_assert(offsetof(CSession, m_robeAlpha) == 0x7EE0); static_assert(offsetof(CSession, m_maxLevel) == 0x7EEC); static_assert(offsetof(CSession, m_cardItems) == 0x811C); diff --git a/Source/Contents/UserData/NormalItemSlots.cpp b/Source/Contents/UserData/NormalItemSlots.cpp index 2364c2cf..7c42e36e 100644 --- a/Source/Contents/UserData/NormalItemSlots.cpp +++ b/Source/Contents/UserData/NormalItemSlots.cpp @@ -127,6 +127,24 @@ int EmotionWndInfo::IsValid() const { this->y <= g_renderer->viewport.height - this->height; } +// OFFSET: 0x009A53E0 +// FUNCTION: fn_13628 +int EquipWndInfo::IsValid() const { + if (this->width != 280) { + return 0; + } + + const int extraHeight = g_session.m_swapEquipmentMode == 1 ? 158 : 0; + if (this->height != 167 && this->height != 17 && this->height != 187 && this->height != 187 + extraHeight) { + return 0; + } + if (this->unknown_0010 != 167 && this->unknown_0010 != 187) { + return 0; + } + + return this->x >= 0 && this->x <= g_renderer->viewport.width - 280 && this->y >= 0 && this->y <= g_renderer->viewport.height - this->height; +} + // OFFSET: 0x009A5460 // FUNCTION: fn_13629 int ExchangeAcceptWndInfo::IsValid() const { diff --git a/Source/Contents/UserData/NormalItemSlots.h b/Source/Contents/UserData/NormalItemSlots.h index c226f451..ee1d6f5c 100644 --- a/Source/Contents/UserData/NormalItemSlots.h +++ b/Source/Contents/UserData/NormalItemSlots.h @@ -134,6 +134,7 @@ struct EquipWndInfo : WindowPlacement { /* 0014 */ int unknown_0014; void Reset(); + int IsValid() const; }; struct ExchangeAcceptWndInfo : WindowPlacement {