mirror of
https://github.com/ZDoom/Raze.git
synced 2025-01-31 04:20:42 +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());
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
FixedBitArray<MAXSECTORS> hitlist;
|
||||
BitArray hitlist(numsectors);
|
||||
|
||||
if (arc.isWriting())
|
||||
{
|
||||
for (int i = 0; i < MAXSECTORS; i++)
|
||||
for (int i = 0; i < numsectors; i++)
|
||||
{
|
||||
hitlist.Set(i, !!SectUser[i].Data());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int i = 0; i < MAXSECTORS; i++)
|
||||
for (int i = 0; i < numsectors; i++)
|
||||
{
|
||||
SectUser[i].Clear();
|
||||
}
|
||||
}
|
||||
arc("sectusermap", hitlist);
|
||||
arc.SparseArray("sectuser", SectUser, MAXSECTORS, hitlist);
|
||||
arc.SerializeMemory("sectusermap", hitlist.Storage().Data(), hitlist.Storage().Size());
|
||||
arc.SparseArray("sectuser", SectUser, numsectors, hitlist);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
|
Loading…
Reference in a new issue