mirror of
https://github.com/DrBeef/Raze.git
synced 2025-02-21 03:01:36 +00:00
- fixed assignment of map hacks with multiple maps assigned.
The parser only ever added the last MD4 but not the others.
This commit is contained in:
parent
35c2d6d14e
commit
18d1084f7c
1 changed files with 11 additions and 6 deletions
|
@ -828,6 +828,7 @@ void parseMapinfo(FScanner& sc, FScriptPosition& pos)
|
|||
{
|
||||
usermaphack_t mhk;
|
||||
FScanner::SavedPos blockend;
|
||||
TArray<FString> md4s;
|
||||
|
||||
if (sc.StartBraces(&blockend)) return;
|
||||
while (!sc.FoundEndBrace(blockend))
|
||||
|
@ -839,14 +840,18 @@ void parseMapinfo(FScanner& sc, FScriptPosition& pos)
|
|||
else if (sc.Compare("mapmd4"))
|
||||
{
|
||||
sc.GetString();
|
||||
for (int i = 0; i < 16; i++)
|
||||
{
|
||||
char smallbuf[3] = { sc.String[2 * i], sc.String[2 * i + 1], 0 };
|
||||
mhk.md4[i] = (uint8_t)strtol(smallbuf, nullptr, 16);
|
||||
}
|
||||
md4s.Push(sc.String);
|
||||
}
|
||||
}
|
||||
AddUserMapHack(mhk);
|
||||
for (auto& md4 : md4s)
|
||||
{
|
||||
for (int i = 0; i < 16; i++)
|
||||
{
|
||||
char smallbuf[3] = { md4[2 * i], md4[2 * i + 1], 0 };
|
||||
mhk.md4[i] = (uint8_t)strtol(smallbuf, nullptr, 16);
|
||||
}
|
||||
AddUserMapHack(mhk);
|
||||
}
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
|
|
Loading…
Reference in a new issue