Skip to content

Commit 2010768

Browse files
committed
Fix CGameCtnReplayRecord 0x000 header chunk for Bench replay
1 parent 3a861aa commit 2010768

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

Src/GBX.NET/Engines/Game/CGameCtnReplayRecord.cs

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -181,29 +181,32 @@ public partial class HeaderChunk03093000 : IVersionable
181181
{
182182
public byte U01;
183183

184-
public int Version { get; set; }
184+
private uint version;
185+
public int Version { get => (int)version; set => version = (uint)value; }
185186

186187
public override void Read(CGameCtnReplayRecord n, GbxReader r)
187188
{
188-
Version = r.ReadInt32();
189+
version = r.ReadUInt32();
189190

190-
if (Version >= 2) // Versionings may not be exact, don't forget to adjust attributes
191+
// This is some decompiled scuffness IDK
192+
if (version >= 4 && version != 9999)
191193
{
192194
n.MapInfo = r.ReadIdent();
193195
n.Time = r.ReadTimeInt32Nullable();
194196
n.PlayerNickname = r.ReadString();
195197

196-
if (Version >= 6)
198+
if (version >= 6)
197199
{
198200
n.PlayerLogin = r.ReadString();
199-
200-
if (Version >= 8)
201-
{
202-
U01 = r.ReadByte();
203-
n.TitleId = r.ReadId();
204-
}
205201
}
206202
}
203+
204+
// capital Version here is important
205+
if (Version > 7)
206+
{
207+
U01 = r.ReadByte();
208+
n.TitleId = r.ReadId();
209+
}
207210
}
208211
}
209212

0 commit comments

Comments
 (0)