Merge pull request #11514 from abcdefg30/64ops
Fix a crash with not space occupying actors granting support powers
This commit is contained in:
@@ -236,7 +236,14 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
var power = Instances.Where(i => !InstanceDisabled(i))
|
var power = Instances.Where(i => !InstanceDisabled(i))
|
||||||
.MinByOrDefault(a => (a.Self.CenterPosition - a.Self.World.Map.CenterOfCell(order.TargetLocation)).HorizontalLengthSquared);
|
.MinByOrDefault(a =>
|
||||||
|
{
|
||||||
|
if (a.Self.OccupiesSpace == null)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
return (a.Self.CenterPosition - a.Self.World.Map.CenterOfCell(order.TargetLocation)).HorizontalLengthSquared;
|
||||||
|
});
|
||||||
|
|
||||||
if (power == null)
|
if (power == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|||||||
@@ -73,13 +73,13 @@ WorldLoaded = function()
|
|||||||
Trigger.OnKilled(Biolab, function()
|
Trigger.OnKilled(Biolab, function()
|
||||||
player.MarkCompletedObjective(destroyBiotechCenterObjective)
|
player.MarkCompletedObjective(destroyBiotechCenterObjective)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
Trigger.OnCapture(Biolab, function()
|
Trigger.OnCapture(Biolab, function()
|
||||||
Biolab.Kill()
|
Biolab.Kill()
|
||||||
end)
|
end)
|
||||||
|
|
||||||
Trigger.OnDamaged(Biolab, HuntTriggerFunction)
|
Trigger.OnDamaged(Biolab, HuntTriggerFunction)
|
||||||
|
|
||||||
AIRepairBuildings(enemy)
|
AIRepairBuildings(enemy)
|
||||||
AIRebuildHarvesters(enemy)
|
AIRebuildHarvesters(enemy)
|
||||||
|
|
||||||
@@ -101,7 +101,7 @@ end
|
|||||||
|
|
||||||
Tick = function()
|
Tick = function()
|
||||||
if DateTime.GameTime > DateTime.Seconds(5) and player.HasNoRequiredUnits() then
|
if DateTime.GameTime > DateTime.Seconds(5) and player.HasNoRequiredUnits() then
|
||||||
player.MarkFailedObjective(destroyBiotechCenterObjective)
|
player.MarkFailedObjective(destroyBiotechCenterObjective)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user