diff --git a/OpenRA.Game/Exts.cs b/OpenRA.Game/Exts.cs index 19d177a95d..0faf5afebb 100644 --- a/OpenRA.Game/Exts.cs +++ b/OpenRA.Game/Exts.cs @@ -374,8 +374,12 @@ namespace OpenRA var result = new T[width, height]; for (var i = 0; i < width; i++) for (var j = 0; j < height; j++) - result[i, j] = i <= ts.GetUpperBound(0) && j <= ts.GetUpperBound(1) - ? ts[i, j] : t; + // Workaround for broken ternary operators in certain versions of mono (3.10 and + // certain versions of the 3.8 series): https://bugzilla.xamarin.com/show_bug.cgi?id=23319 + if (i <= ts.GetUpperBound(0) && j <= ts.GetUpperBound(1)) + result[i, j] = ts[i, j]; + else + result[i, j] = t; return result; } diff --git a/OpenRA.Mods.RA/Render/WithMuzzleFlash.cs b/OpenRA.Mods.RA/Render/WithMuzzleFlash.cs index 2db391aadd..40a59d9a26 100644 --- a/OpenRA.Mods.RA/Render/WithMuzzleFlash.cs +++ b/OpenRA.Mods.RA/Render/WithMuzzleFlash.cs @@ -51,8 +51,14 @@ namespace OpenRA.Mods.RA.Render var turreted = self.TraitsImplementing() .FirstOrDefault(t => t.Name == arm.Info.Turret); - getFacing = turreted != null ? () => turreted.TurretFacing : - facing != null ? (Func)(() => facing.Facing) : () => 0; + // Workaround for broken ternary operators in certain versions of mono (3.10 and + // certain versions of the 3.8 series): https://bugzilla.xamarin.com/show_bug.cgi?id=23319 + if (turreted != null) + getFacing = () => turreted.TurretFacing; + else if (facing != null) + getFacing = (Func)(() => facing.Facing); + else + getFacing = () => 0; var muzzleFlash = new Animation(self.World, render.GetImage(self), getFacing); visible.Add(barrel, false);