Merge pull request #9634 from pchote/fix-bridge-huts

Fix bridge destruction and repair.
This commit is contained in:
abcdefg30
2015-10-17 23:51:14 +02:00
2 changed files with 8 additions and 5 deletions

View File

@@ -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;

View File

@@ -493,8 +493,9 @@ BRIDGEHUT:
Building:
Footprint: __ __
Dimensions: 2,2
CustomSelectionSize:
CustomBounds: 48,48
Selectable:
Bounds: 48,48
Priority: 2
BridgeHut:
Targetable:
TargetTypes: BridgeHut, C4
@@ -504,8 +505,9 @@ BRIDGEHUT.small:
Building:
Footprint: _
Dimensions: 1,1
CustomSelectionSize:
CustomBounds: 24,24
Selectable:
Bounds: 24,24
Priority: 2
BridgeHut:
Targetable:
TargetTypes: BridgeHut, C4