Updated CPos struct to use a bit field for all properties.

This commit is contained in:
teinarss
2018-10-01 17:57:28 +02:00
committed by Paul Chote
parent 9f82ef999f
commit cfaf5a6467
7 changed files with 61 additions and 14 deletions

View File

@@ -128,7 +128,7 @@ namespace OpenRA
{
if (flags.HasField(OrderFields.TargetIsCell))
{
var cell = new CPos(r.ReadInt32(), r.ReadInt32(), r.ReadByte());
var cell = new CPos(r.ReadInt32());
var subCell = (SubCell)r.ReadByte();
if (world != null)
target = Target.FromCell(world, cell, subCell);
@@ -146,7 +146,7 @@ namespace OpenRA
var targetString = flags.HasField(OrderFields.TargetString) ? r.ReadString() : null;
var queued = flags.HasField(OrderFields.Queued);
var extraLocation = flags.HasField(OrderFields.ExtraLocation) ? new CPos(r.ReadInt32(), r.ReadInt32(), r.ReadByte()) : CPos.Zero;
var extraLocation = flags.HasField(OrderFields.ExtraLocation) ? new CPos(r.ReadInt32()) : CPos.Zero;
var extraData = flags.HasField(OrderFields.ExtraData) ? r.ReadUInt32() : 0;
if (world == null)