mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-08-23 22:55:31 -07:00
Prevents leading 0s added to hash from being in file name
This commit is contained in:
parent
bba59509f3
commit
cb0f4ffd97
1 changed files with 5 additions and 3 deletions
|
@ -39,11 +39,13 @@ std::string placementtxt;
|
||||||
static SpoilerData spoilerData;
|
static SpoilerData spoilerData;
|
||||||
|
|
||||||
void GenerateHash() {
|
void GenerateHash() {
|
||||||
while (Settings::hash.length() < 10) {
|
std::string hash = Settings::hash;
|
||||||
Settings::hash = "0" + Settings::hash;
|
// adds leading 0s to the hash string if it has less than 10 digits.
|
||||||
|
while (hash.length() < 10) {
|
||||||
|
hash = "0" + hash;
|
||||||
}
|
}
|
||||||
for (size_t i = 0, j = 0; i < Settings::hashIconIndexes.size(); i++, j += 2) {
|
for (size_t i = 0, j = 0; i < Settings::hashIconIndexes.size(); i++, j += 2) {
|
||||||
int number = std::stoi(Settings::hash.substr(j, 2));
|
int number = std::stoi(hash.substr(j, 2));
|
||||||
Settings::hashIconIndexes[i] = number;
|
Settings::hashIconIndexes[i] = number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue