Merge pull request #7976 from pchote/subcell-crash
Don’t crash when asking for the offset of an invalid subcell.
This commit is contained in:
@@ -190,7 +190,13 @@ namespace OpenRA
|
|||||||
public Bitmap CustomPreview;
|
public Bitmap CustomPreview;
|
||||||
public bool InvalidCustomRules { get; private set; }
|
public bool InvalidCustomRules { get; private set; }
|
||||||
|
|
||||||
public WVec OffsetOfSubCell(SubCell subCell) { return SubCellOffsets[(int)subCell]; }
|
public WVec OffsetOfSubCell(SubCell subCell)
|
||||||
|
{
|
||||||
|
if (subCell == SubCell.Invalid || subCell == SubCell.Any)
|
||||||
|
return WVec.Zero;
|
||||||
|
|
||||||
|
return SubCellOffsets[(int)subCell];
|
||||||
|
}
|
||||||
|
|
||||||
[FieldLoader.LoadUsing("LoadOptions")] public MapOptions Options;
|
[FieldLoader.LoadUsing("LoadOptions")] public MapOptions Options;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user