mirror of
https://gitlab.com/Syroot/Worms.git
synced 2025-01-27 14:18:00 +03:00
Armageddon: Read and write signature as unsigned integer instead of string.
This commit is contained in:
parent
6d2864e6f7
commit
b44ae666b6
@ -19,7 +19,7 @@ namespace Syroot.Worms.Armageddon
|
||||
{
|
||||
// ---- CONSTANTS ----------------------------------------------------------------------------------------------
|
||||
|
||||
private const string _signature = "SCHM";
|
||||
private const uint _signature = 0x4D484353; // "SCHM"
|
||||
|
||||
private const int _objectCount5Step = 30;
|
||||
private const int _objectCount10Step = 44;
|
||||
@ -1024,7 +1024,7 @@ namespace Syroot.Worms.Armageddon
|
||||
}
|
||||
|
||||
// Read the header.
|
||||
if (reader.ReadString(_signature.Length) != _signature)
|
||||
if (reader.ReadUInt32() != _signature)
|
||||
throw new InvalidDataException("Invalid scheme file signature.");
|
||||
Version = reader.ReadEnum<SchemeVersion>(true);
|
||||
|
||||
@ -1156,7 +1156,7 @@ namespace Syroot.Worms.Armageddon
|
||||
|
||||
// Write the header.
|
||||
SchemeVersion version = (SchemeVersion)((uint)format >> 16);
|
||||
writer.Write(_signature, StringCoding.Raw);
|
||||
writer.Write(_signature);
|
||||
writer.WriteEnum(version);
|
||||
|
||||
// Write the options.
|
||||
|
Loading…
x
Reference in New Issue
Block a user