Fix issue with capturing enemy buildings in 'Intervention' mission

The onDamaged event handler would still fire after an enemy building had
been captured. Fixed by checking the owner before starting repairs.

Thanks to Microbit for showing me that people actually did that.
This commit is contained in:
Oliver Brakmann
2014-06-22 13:59:16 +02:00
parent c12527e866
commit cf2fad673d

View File

@@ -188,7 +188,9 @@ SetupWorld = function()
Utils.Do(Actor.ActorsWithTrait("RepairableBuilding"), function(building)
if Actor.Owner(building) == soviets then
Actor.OnDamaged(building, function(b)
Actor.RepairBuilding(b)
if Actor.Owner(b) == soviets then
Actor.RepairBuilding(b)
end
end)
end
end)