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:
parent
94942dd610
commit
f621c6d8b9
1 changed files with 35 additions and 0 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue