diff --git a/Source/Contents/GuildEmblemLookup.cpp b/Source/Contents/GuildEmblemLookup.cpp new file mode 100644 index 0000000..07a2940 --- /dev/null +++ b/Source/Contents/GuildEmblemLookup.cpp @@ -0,0 +1,21 @@ +#include "Client/Replay.h" +#include "Contents/Emblems/EmblemCache.h" +#include "Contents/Emblems/GuildEmblemReqBundle.h" +#include "Contents/GuildMgr.h" +#include "Resource/ResourceMgr.h" + +// OFFSET: 0x0065E450 +// FUNCTION: fn_05174 +std::string CGuildMgr::GetEmblemFilename(std::uint32_t guildId) { + const auto found = this->m_guilds.find(guildId); + if (found == this->m_guilds.end() || found->second.m_emblemVersion <= 0) { + return std::string(); + } + + std::string filename = reinterpret_cast(this)->Filename(guildId, found->second.m_emblemVersion); + if (!ResourceMgr::Instance().Load(filename) && g_replayAnimationScaling == 0) { + this->m_reqBundle->Add(guildId, this->GetEmblemVersion(guildId)); + } + + return filename; +} diff --git a/Source/Contents/GuildMgr.h b/Source/Contents/GuildMgr.h index 741de10..0ba9dca 100644 --- a/Source/Contents/GuildMgr.h +++ b/Source/Contents/GuildMgr.h @@ -29,6 +29,7 @@ public: static void Destroy(); int GetEmblemVersion(std::uint32_t guildId) const; + std::string GetEmblemFilename(std::uint32_t guildId); void SetEmblemVersion(std::uint32_t guildId, int version); void UpdateEmblemRequests( CEmblemDataMgr& emblems, std::uint32_t accountId, const std::string& accountName, const char* token16, CConnection& connection, CAsyncWorkMgr& manager diff --git a/data/compile.json b/data/compile.json index 76b3fc0..2b30f6f 100644 --- a/data/compile.json +++ b/data/compile.json @@ -341,6 +341,7 @@ "Source/Contents/Ground/TerrainHeight.cpp": 4, "Source/Contents/Ground/TerrainPicking.cpp": 4, "Source/Contents/Ground/TerrainPlane.cpp": 4, + "Source/Contents/GuildEmblemLookup.cpp": 4, "Source/Contents/GuildEmblemState.cpp": 4, "Source/Contents/GuildMgr.cpp": 4, "Source/Contents/HeadResources.cpp": 4,