Decompile fn_21889 (CGameMode::ReceiveGuildPositionInfo)
Batch #8771 by aDw: 0 byte-identical, 1 confirmed by peer review. - fn_21889 CGameMode::ReceiveGuildPositionInfo: logic confirmed by peer review Peer-reviewed-by: eAthena, dori Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes).
This commit is contained in:
parent
3e4660e96e
commit
2bde55e719
2 changed files with 32 additions and 0 deletions
|
|
@ -655,6 +655,7 @@ public:
|
|||
void ReceiveEquipWindowMicroscope2(const unsigned char* packet);
|
||||
void ReceiveEquipWindowMicroscope3(const unsigned char* packet);
|
||||
void ReceiveGuildMemberAdd(const unsigned char* packet);
|
||||
void ReceiveGuildPositionInfo(const unsigned char* packet);
|
||||
void ReceiveRodexMailReturn(const unsigned char* packet);
|
||||
void ReceiveActorStatusValuePacket(const unsigned char* packet);
|
||||
void ReceivePartyMemberEffect(const unsigned char* packet);
|
||||
|
|
|
|||
|
|
@ -7228,3 +7228,34 @@ void CGameMode::ReceiveGuildMemberAdd(const unsigned char* packet) {
|
|||
guildInfo->UpdateMemberExpRatios();
|
||||
g_windowMgr.RefreshGuildWindows();
|
||||
}
|
||||
|
||||
// OFFSET: 0x00D510C0
|
||||
// FUNCTION: fn_21889
|
||||
void CGameMode::ReceiveGuildPositionInfo(const unsigned char* packet) {
|
||||
GuildInfo* guildInfo = reinterpret_cast<GuildInfo*>(reinterpret_cast<char*>(&g_guildId) - offsetof(GuildInfo, m_guildId));
|
||||
const int count = static_cast<unsigned>(*reinterpret_cast<const std::int16_t*>(packet + 2) - 4) >> 4;
|
||||
guildInfo->unknown_00D4.clear();
|
||||
|
||||
const unsigned char* entry = packet + 4;
|
||||
for (int index = 0; index < count; ++index, entry += 16) {
|
||||
const int positionId = *reinterpret_cast<const int*>(entry);
|
||||
std::string name;
|
||||
name = guildInfo->m_positions[positionId];
|
||||
|
||||
const unsigned int mode = *reinterpret_cast<const unsigned int*>(entry + 4);
|
||||
GuildInfo::Unknown00D4Entry position;
|
||||
position.unknown_0000 = *reinterpret_cast<const int*>(entry + 8);
|
||||
position.unknown_0004 = positionId;
|
||||
position.unknown_0008 = name;
|
||||
position.unknown_0020 = mode & 1;
|
||||
position.unknown_0024 = (mode >> 4) & 1;
|
||||
position.unknown_0028 = *reinterpret_cast<const int*>(entry + 12);
|
||||
position.unknown_002C = (mode >> 8) & 1;
|
||||
guildInfo->unknown_00D4.push_back(position);
|
||||
}
|
||||
|
||||
guildInfo->unknown_00D4.sort([](const GuildInfo::Unknown00D4Entry& left, const GuildInfo::Unknown00D4Entry& right) {
|
||||
return left.unknown_0004 < right.unknown_0004;
|
||||
});
|
||||
g_windowMgr.RefreshGuildWindows();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue