From f621c6d8b9f93d77007efbc2e158e25af44d2811 Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Fri, 30 Oct 2026 18:03:47 +0000 Subject: [PATCH] Decompile fn_17810 (sub_AD1270) Batch #5836 by Yommy: 0 byte-identical, 1 confirmed by peer review. - fn_17810 sub_AD1270: logic confirmed by peer review Peer-reviewed-by: ragnarok-clanker, KWDev, SapitoSucio Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). --- .../Configuration/ServiceConfiguration.cpp | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/Source/Contents/Configuration/ServiceConfiguration.cpp b/Source/Contents/Configuration/ServiceConfiguration.cpp index 0d5654c0..debfa9db 100644 --- a/Source/Contents/Configuration/ServiceConfiguration.cpp +++ b/Source/Contents/Configuration/ServiceConfiguration.cpp @@ -300,3 +300,38 @@ void LoadLoadingScreens(int count) { } // OFFSET: 0x00AD1270 +// FUNCTION: fn_17810 +void sub_AD1270() { + if (ResourceExists("etcinfo.txt", 0)) { + CCommonObject storage; + g_loadingScreens.clear(); + + std::vector tokens; + EtcInfoBytes file; + storage.LoadTokens(tokens, "etcinfo.txt", 0, file); + + for (auto token = tokens.begin(); token != tokens.end(); ++token) { + if (std::strcmp(*token, "loadingscreen") == 0) { + const int count = std::atoi(token[1]); + if (count > 0) { + LoadLoadingScreens(count); + } + } else if (std::strcmp(*token, "event") == 0) { + if (std::atoi(token[1]) > 0) { + g_pakRegistry.Add("event.grf"); + } + } else if (std::strcmp(*token, "weather") == 0) { + std::string mapName(token[1]); + token += 2; + std::string weather(*token); + LowercaseText(mapName); + LowercaseText(weather); + g_weatherEffect.AddMapWeather(mapName, weather); + } + } + } + + if (g_loadingScreens.empty()) { + LoadLoadingScreens(0); + } +}