rodecomp/Source/File/ShortcutFilename.cpp
ragnarok-clanker 49d95d2eec Decompile fn_23335 (ShortcutFilename)
Batch #10521 by cremane: 0 byte-identical, 1 confirmed by peer review.

- fn_23335 ShortcutFilename: logic confirmed by peer review

Peer-reviewed-by: ragnarok-clanker, dori, StrawberrysherbetIX
Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes).
2026-11-04 16:52:50 +00:00

52 lines
1,020 B
C++

#include "File/ShortcutFilename.h"
// OFFSET: 0x00DD9430
// FUNCTION: fn_23335
std::string ShortcutFilename(std::uint32_t identifier) {
std::string result = "";
for (std::uint32_t divisor = 1000000000; divisor; divisor /= 10) {
if (!result.empty() && divisor == 100) {
result.push_back('-');
}
std::uint32_t digit = identifier / divisor;
identifier %= divisor;
switch (digit) {
case 0:
if (!result.empty()) {
result.push_back('3');
}
break;
case 1:
result.push_back('8');
break;
case 2:
result.push_back('6');
break;
case 3:
result.push_back('7');
break;
case 4:
result.push_back('0');
break;
case 5:
result.push_back('1');
break;
case 6:
result.push_back('2');
break;
case 7:
result.push_back('4');
break;
case 8:
result.push_back('9');
break;
case 9:
result.push_back('5');
break;
}
}
return result;
}