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).
This commit is contained in:
ragnarok-clanker 2026-10-30 18:03:47 +00:00
commit f621c6d8b9

View file

@ -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<char*> 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);
}
}