From 42263704959b76680be02190b873fecba1e1f258 Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Wed, 14 Oct 2015 19:48:46 +0100 Subject: [PATCH] Fix bridge destruction and repair. --- OpenRA.Mods.Common/Traits/Buildings/Bridge.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/OpenRA.Mods.Common/Traits/Buildings/Bridge.cs b/OpenRA.Mods.Common/Traits/Buildings/Bridge.cs index 846e09ef8f..f9240716b0 100644 --- a/OpenRA.Mods.Common/Traits/Buildings/Bridge.cs +++ b/OpenRA.Mods.Common/Traits/Buildings/Bridge.cs @@ -152,6 +152,7 @@ namespace OpenRA.Mods.Common.Traits internal void AddHut(BridgeHut hut) { + // TODO: This method is incomprehensible and fragile, and should be rewritten. if (huts[0] == huts[1]) huts[1] = hut; if (Hut == null) @@ -161,7 +162,7 @@ namespace OpenRA.Mods.Common.Traits huts[0] = hut; // Set only first time for (var d = 0; d <= 1; d++) for (var b = neighbours[d]; b != null; b = b.Hut == null ? b.neighbours[d] : null) - b.huts[1 - d] = hut; + b.huts[d] = hut; } else Hut = null;