- fixed: array clamping may only be done when reading a savegame.

- fixed generation of savegame names for level snapshots.
This commit is contained in:
Christoph Oelckers 2016-09-22 11:51:29 +02:00
parent e01965b747
commit 68dc75bf9e
2 changed files with 7 additions and 4 deletions

View file

@ -1571,7 +1571,7 @@ void G_WriteSnapshots(TArray<FString> &filenames, TArray<FCompressedBuffer> &buf
{
if (wadlevelinfos[i].Snapshot.mCompressedSize > 0)
{
filename << wadlevelinfos[i].MapName << ".map.json";
filename.Format("%s.map.json", wadlevelinfos[i].MapName.GetChars());
filename.ToLower();
filenames.Push(filename);
buffers.Push(wadlevelinfos[i].Snapshot);
@ -1579,7 +1579,7 @@ void G_WriteSnapshots(TArray<FString> &filenames, TArray<FCompressedBuffer> &buf
}
if (TheDefaultLevelInfo.Snapshot.mCompressedSize > 0)
{
filename << TheDefaultLevelInfo.MapName << ".mapd.json";
filename.Format("%s.mapd.json", TheDefaultLevelInfo.MapName.GetChars());
filename.ToLower();
filenames.Push(filename);
buffers.Push(TheDefaultLevelInfo.Snapshot);

View file

@ -111,8 +111,11 @@ public:
if (BeginArray(key))
{
int max = ArraySize();
if (max < count) count = max;
if (isReading())
{
int max = ArraySize();
if (max < count) count = max;
}
for (int i = 0; i < count; i++)
{
Serialize(*this, nullptr, obj[i], (T*)nullptr);