View | Details | Raw Unified | Return to bug 195371
Collapse All | Expand All

(-)games/openra/Makefile (+1 lines)
Lines 2-7 Link Here
2
2
3
PORTNAME=	openra
3
PORTNAME=	openra
4
PORTVERSION=	20141029
4
PORTVERSION=	20141029
5
PORTREVISION=	1
5
CATEGORIES=	games
6
CATEGORIES=	games
6
7
7
MAINTAINER=	jbeich@vfemail.net
8
MAINTAINER=	jbeich@vfemail.net
(-)games/openra/files/patch-xamarin-bug23319 (-10 / +35 lines)
Lines 1-25 Link Here
1
# https://bugzilla.xamarin.com/show_bug.cgi?id=23319
1
commit 04cbea3
2
# https://github.com/mono/mono/commit/1d94d17
2
Author: Gordon Martin <gordonhughmartin@gmail.com>
3
Date:   Tue Nov 11 13:35:49 2014 +0000
3
4
4
--- OpenRA.Game/Exts.cs~
5
    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
6
---
7
 OpenRA.Game/Exts.cs                      |  8 ++++++--
8
 OpenRA.Mods.RA/Render/WithMuzzleFlash.cs | 10 ++++++++--
9
 2 files changed, 14 insertions(+), 4 deletions(-)
10
11
diff --git OpenRA.Game/Exts.cs OpenRA.Game/Exts.cs
12
index 19d177a..0faf5af 100644
13
--- OpenRA.Game/Exts.cs
5
+++ OpenRA.Game/Exts.cs
14
+++ OpenRA.Game/Exts.cs
6
@@ -375,7 +375,7 @@ namespace OpenRA
15
@@ -374,8 +374,12 @@ public static T[] MakeArray<T>(int count, Func<int, T> f)
16
 			var result = new T[width, height];
7
 			for (var i = 0; i < width; i++)
17
 			for (var i = 0; i < width; i++)
8
 				for (var j = 0; j < height; j++)
18
 				for (var j = 0; j < height; j++)
9
 					result[i, j] = i <= ts.GetUpperBound(0) && j <= ts.GetUpperBound(1)
19
-					result[i, j] = i <= ts.GetUpperBound(0) && j <= ts.GetUpperBound(1)
10
-						? ts[i, j] : t;
20
-						? ts[i, j] : t;
11
+						? (ts[i, j]) : t;
21
+					// Workaround for broken ternary operators in certain versions of mono (3.10 and  
22
+					// certain versions of the 3.8 series): https://bugzilla.xamarin.com/show_bug.cgi?id=23319
23
+					if (i <= ts.GetUpperBound(0) && j <= ts.GetUpperBound(1))
24
+						result[i, j] = ts[i, j];
25
+					else
26
+						result[i, j] = t;
12
 			return result;
27
 			return result;
13
 		}
28
 		}
14
 
29
 
15
--- OpenRA.Mods.RA/Render/WithMuzzleFlash.cs~
30
diff --git OpenRA.Mods.RA/Render/WithMuzzleFlash.cs OpenRA.Mods.RA/Render/WithMuzzleFlash.cs
31
index 2db391a..40a59d9 100644
32
--- OpenRA.Mods.RA/Render/WithMuzzleFlash.cs
16
+++ OpenRA.Mods.RA/Render/WithMuzzleFlash.cs
33
+++ OpenRA.Mods.RA/Render/WithMuzzleFlash.cs
17
@@ -50,7 +50,7 @@ namespace OpenRA.Mods.RA.Render
34
@@ -51,8 +51,14 @@ public WithMuzzleFlash(Actor self, WithMuzzleFlashInfo info)
18
 					var turreted = self.TraitsImplementing<Turreted>()
35
 					var turreted = self.TraitsImplementing<Turreted>()
19
 						.FirstOrDefault(t => t.Name ==  arm.Info.Turret);
36
 						.FirstOrDefault(t => t.Name ==  arm.Info.Turret);
20
 
37
 
21
-					getFacing = turreted != null ? () => turreted.TurretFacing :
38
-					getFacing = turreted != null ? () => turreted.TurretFacing :
22
+					getFacing = turreted != null ? (() => turreted.TurretFacing) :
39
-						facing != null ? (Func<int>)(() => facing.Facing) : () => 0;
23
 						facing != null ? (Func<int>)(() => facing.Facing) : () => 0;
40
+					// Workaround for broken ternary operators in certain versions of mono (3.10 and  
41
+					// certain versions of the 3.8 series): https://bugzilla.xamarin.com/show_bug.cgi?id=23319
42
+					if (turreted != null)
43
+						getFacing = () => turreted.TurretFacing;
44
+					else if (facing != null)
45
+						getFacing = (Func<int>)(() => facing.Facing);
46
+					else
47
+						getFacing = () => 0;
24
 
48
 
25
 					var muzzleFlash = new Animation(self.World, render.GetImage(self), getFacing);
49
 					var muzzleFlash = new Animation(self.World, render.GetImage(self), getFacing);
50
 					visible.Add(barrel, false);

Return to bug 195371