1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-10-19 19:59:43 +00:00

- Replace custom patch which fixes ternary operators to upstream one

PR:		195371
Submitted by:	jbeich@vfemail.net (maintainer)
This commit is contained in:
Dmitry Marakasov 2014-11-28 11:52:44 +00:00
parent 5f19ee0628
commit da777518f2
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=373560
2 changed files with 36 additions and 10 deletions

View File

@ -2,6 +2,7 @@
PORTNAME= openra
PORTVERSION= 20141029
PORTREVISION= 1
CATEGORIES= games
MAINTAINER= jbeich@vfemail.net

View File

@ -1,25 +1,50 @@
# https://bugzilla.xamarin.com/show_bug.cgi?id=23319
# https://github.com/mono/mono/commit/1d94d17
commit 04cbea3
Author: Gordon Martin <gordonhughmartin@gmail.com>
Date: Tue Nov 11 13:35:49 2014 +0000
--- OpenRA.Game/Exts.cs~
Desugaring a couple of ternary expressions which prevented OpenRA building on Mono 3.10 and certain versions of the 3.8 series due to a bug in Mono: https://bugzilla.xamarin.com/show_bug.cgi?id=23319
---
OpenRA.Game/Exts.cs | 8 ++++++--
OpenRA.Mods.RA/Render/WithMuzzleFlash.cs | 10 ++++++++--
2 files changed, 14 insertions(+), 4 deletions(-)
diff --git OpenRA.Game/Exts.cs OpenRA.Game/Exts.cs
index 19d177a..0faf5af 100644
--- OpenRA.Game/Exts.cs
+++ OpenRA.Game/Exts.cs
@@ -375,7 +375,7 @@ namespace OpenRA
@@ -374,8 +374,12 @@ public static T[] MakeArray<T>(int count, Func<int, T> f)
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)
- result[i, j] = i <= ts.GetUpperBound(0) && j <= ts.GetUpperBound(1)
- ? ts[i, j] : t;
+ ? (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;
}
--- OpenRA.Mods.RA/Render/WithMuzzleFlash.cs~
diff --git OpenRA.Mods.RA/Render/WithMuzzleFlash.cs OpenRA.Mods.RA/Render/WithMuzzleFlash.cs
index 2db391a..40a59d9 100644
--- OpenRA.Mods.RA/Render/WithMuzzleFlash.cs
+++ OpenRA.Mods.RA/Render/WithMuzzleFlash.cs
@@ -50,7 +50,7 @@ namespace OpenRA.Mods.RA.Render
@@ -51,8 +51,14 @@ public WithMuzzleFlash(Actor self, WithMuzzleFlashInfo info)
var turreted = self.TraitsImplementing<Turreted>()
.FirstOrDefault(t => t.Name == arm.Info.Turret);
- getFacing = turreted != null ? () => turreted.TurretFacing :
+ getFacing = turreted != null ? (() => turreted.TurretFacing) :
facing != null ? (Func<int>)(() => facing.Facing) : () => 0;
- facing != null ? (Func<int>)(() => 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<int>)(() => facing.Facing);
+ else
+ getFacing = () => 0;
var muzzleFlash = new Animation(self.World, render.GetImage(self), getFacing);
visible.Add(barrel, false);