mirror of
https://github.com/DrBeef/Raze.git
synced 2025-01-31 13:10:39 +00:00
- SW: only check valid sectors for SecUser entries.
This commit is contained in:
parent
6bd239c5b7
commit
75e2d801a7
2 changed files with 10 additions and 5 deletions
|
@ -1703,6 +1703,11 @@ public:
|
||||||
{
|
{
|
||||||
memset(&bytes[0], 0, bytes.Size());
|
memset(&bytes[0], 0, bytes.Size());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TArray<uint8_t> &Storage()
|
||||||
|
{
|
||||||
|
return bytes;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -819,24 +819,24 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, SECT_USER& w, SECT
|
||||||
|
|
||||||
void SerializeSectUser(FSerializer& arc)
|
void SerializeSectUser(FSerializer& arc)
|
||||||
{
|
{
|
||||||
FixedBitArray<MAXSECTORS> hitlist;
|
BitArray hitlist(numsectors);
|
||||||
|
|
||||||
if (arc.isWriting())
|
if (arc.isWriting())
|
||||||
{
|
{
|
||||||
for (int i = 0; i < MAXSECTORS; i++)
|
for (int i = 0; i < numsectors; i++)
|
||||||
{
|
{
|
||||||
hitlist.Set(i, !!SectUser[i].Data());
|
hitlist.Set(i, !!SectUser[i].Data());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
for (int i = 0; i < MAXSECTORS; i++)
|
for (int i = 0; i < numsectors; i++)
|
||||||
{
|
{
|
||||||
SectUser[i].Clear();
|
SectUser[i].Clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
arc("sectusermap", hitlist);
|
arc.SerializeMemory("sectusermap", hitlist.Storage().Data(), hitlist.Storage().Size());
|
||||||
arc.SparseArray("sectuser", SectUser, MAXSECTORS, hitlist);
|
arc.SparseArray("sectuser", SectUser, numsectors, hitlist);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
|
Loading…
Reference in a new issue