Changed SubCell to byte
This commit is contained in:
@@ -31,10 +31,10 @@ namespace OpenRA.Mods.Common
|
||||
|
||||
public class SubCellInit : IActorInit<SubCell>
|
||||
{
|
||||
[FieldFromYamlKey] readonly int value = (int)SubCell.FullCell;
|
||||
[FieldFromYamlKey] readonly byte value = (byte)SubCell.FullCell;
|
||||
public SubCellInit() { }
|
||||
public SubCellInit(int init) { value = init; }
|
||||
public SubCellInit(SubCell init) { value = (int)init; }
|
||||
public SubCellInit(byte init) { value = init; }
|
||||
public SubCellInit(SubCell init) { value = (byte)init; }
|
||||
public SubCell Value(World world) { return (SubCell)value; }
|
||||
}
|
||||
|
||||
|
||||
@@ -297,8 +297,8 @@ namespace OpenRA.Mods.Common.Traits
|
||||
if (!AnyActorsAt(cell))
|
||||
return map.Grid.DefaultSubCell;
|
||||
|
||||
for (var i = (int)SubCell.First; i < map.Grid.SubCellOffsets.Length; i++)
|
||||
if (i != (int)preferredSubCell && !AnyActorsAt(cell, (SubCell)i, checkIfBlocker))
|
||||
for (var i = (byte)SubCell.First; i < map.Grid.SubCellOffsets.Length; i++)
|
||||
if (i != (byte)preferredSubCell && !AnyActorsAt(cell, (SubCell)i, checkIfBlocker))
|
||||
return (SubCell)i;
|
||||
return SubCell.Invalid;
|
||||
}
|
||||
|
||||
@@ -237,7 +237,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
if (!previews.Any())
|
||||
return map.Grid.DefaultSubCell;
|
||||
|
||||
for (var i = (int)SubCell.First; i < map.Grid.SubCellOffsets.Length; i++)
|
||||
for (var i = (byte)SubCell.First; i < map.Grid.SubCellOffsets.Length; i++)
|
||||
if (!previews.Any(p => p.Footprint[cell] == (SubCell)i))
|
||||
return (SubCell)i;
|
||||
|
||||
|
||||
@@ -415,7 +415,7 @@ namespace OpenRA.Mods.Common.UtilityCommands
|
||||
initDict.Add(new FacingInit(255 - facing));
|
||||
|
||||
if (section == "INFANTRY")
|
||||
actor.Add(new SubCellInit(Exts.ParseIntegerInvariant(parts[4])));
|
||||
actor.Add(new SubCellInit(Exts.ParseByte(parts[4])));
|
||||
|
||||
var actorCount = map.ActorDefinitions.Count;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user