From ee72f2e447643cb31468a13066f991bf45cdce60 Mon Sep 17 00:00:00 2001 From: Alice Ogeda Date: Thu, 2 Jan 2025 23:56:59 -0300 Subject: [PATCH] fix crash on mobkills due to misuse of classjob index; --- deps/datReader/Exd/Structs.h | 6 +++--- src/world/Actor/Player.cpp | 6 ++++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/deps/datReader/Exd/Structs.h b/deps/datReader/Exd/Structs.h index 9baf7f18..d2604a30 100644 --- a/deps/datReader/Exd/Structs.h +++ b/deps/datReader/Exd/Structs.h @@ -302,18 +302,18 @@ namespace Excel uint16_t LimitBreakAction[3]; uint16_t PvpLimitBreakAction[3]; uint8_t Kind; - uint8_t UIPriority; uint8_t Unknown6; + uint8_t JobIndex; uint8_t MainClass; uint8_t Role; uint8_t Town; - int8_t MonsterNote; + int8_t UIPriority; int8_t StartingLevel; uint8_t PartyBuff; int8_t WorkIndex; int8_t BattleClassIndex; int8_t CraftingClassIndex; - int8_t Unknown7; + int8_t MonsterNote; }; /* 63507 */ diff --git a/src/world/Actor/Player.cpp b/src/world/Actor/Player.cpp index 76bb6e27..cbb8fb6e 100644 --- a/src/world/Actor/Player.cpp +++ b/src/world/Actor/Player.cpp @@ -1597,9 +1597,11 @@ void Player::updateHuntingLog( uint16_t id ) if( !classJobInfo ) return; - auto currentClassId = classJobInfo->data().MainClass; + auto currentClassId = classJobInfo->data().MonsterNote; + if( currentClassId == -1 || currentClassId == 127 ) + return; - auto& logEntry = m_huntingLogEntries[ currentClassId - 1 ]; + auto& logEntry = m_huntingLogEntries[ currentClassId ]; bool logChanged = false;