Decompile fn_21954 (CGuildMgr::ReceiveEmblem)
Batch #12384 by cremane: 0 byte-identical, 1 confirmed by peer review. - fn_21954 CGuildMgr::ReceiveEmblem: logic confirmed by peer review 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
22bb35351e
commit
2e615a1f46
1 changed files with 15 additions and 10 deletions
|
|
@ -22,14 +22,14 @@
|
|||
|
||||
namespace {
|
||||
// INLINED
|
||||
__forceinline std::string Basename(std::string path) {
|
||||
__forceinline std::string Basename(const std::string& path) {
|
||||
std::string name = path;
|
||||
const auto separator = path.rfind('\\');
|
||||
|
||||
if (separator != std::string::npos) {
|
||||
return path.substr(separator + 1);
|
||||
name = path.substr(separator + 1);
|
||||
}
|
||||
|
||||
return path;
|
||||
return name;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -98,18 +98,23 @@ void CGuildMgr::StoreEmblem(const void* bytes, std::uint32_t size, std::uint32_t
|
|||
// FUNCTION: fn_21954
|
||||
void __stdcall CGuildMgr::ReceiveEmblem(std::uint16_t state, std::uint32_t guild, std::uint32_t revision, const unsigned char* bytes, int size) {
|
||||
CGuildMgr* manager = g_guildMgr;
|
||||
|
||||
if (state == 0) {
|
||||
switch (state) {
|
||||
case 0:
|
||||
manager->m_receiveGuildId = guild;
|
||||
manager->m_receiveVersion = revision;
|
||||
manager->m_receiveData.clear();
|
||||
} else if (state == 1) {
|
||||
break;
|
||||
case 1:
|
||||
if (guild == manager->m_receiveGuildId && revision == manager->m_receiveVersion) {
|
||||
manager->m_receiveData.insert(manager->m_receiveData.end(), bytes, bytes + size);
|
||||
}
|
||||
} else if (state == 2 && guild == manager->m_receiveGuildId && revision == manager->m_receiveVersion) {
|
||||
StoreEmblem(manager->m_receiveData.data(), static_cast<std::uint32_t>(manager->m_receiveData.size()), guild, revision);
|
||||
RefreshEmblem(guild);
|
||||
break;
|
||||
case 2:
|
||||
if (guild == manager->m_receiveGuildId && revision == manager->m_receiveVersion) {
|
||||
StoreEmblem(manager->m_receiveData.data(), static_cast<std::uint32_t>(manager->m_receiveData.size()), guild, revision);
|
||||
RefreshEmblem(guild);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue