Fix crates spawning subcell incorrectly and spawned actors not crushing crates/mines
This commit is contained in:
committed by
Matthias Mailänder
parent
2de212710a
commit
54dac39e83
@@ -101,11 +101,15 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
|
|
||||||
for (var i = 0; i < duplicates; i++)
|
for (var i = 0; i < duplicates; i++)
|
||||||
{
|
{
|
||||||
w.CreateActor(collector.Info.Name, new TypeDictionary
|
var actor = w.CreateActor(collector.Info.Name, new TypeDictionary
|
||||||
{
|
{
|
||||||
new LocationInit(candidateCells[i]),
|
new LocationInit(candidateCells[i]),
|
||||||
new OwnerInit(info.Owner ?? collector.Owner.InternalName)
|
new OwnerInit(info.Owner ?? collector.Owner.InternalName)
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Set the subcell and make sure to crush actors beneath.
|
||||||
|
var positionable = actor.OccupiesSpace as IPositionable;
|
||||||
|
positionable.SetPosition(actor, actor.Location, positionable.GetAvailableSubCell(actor.Location, ignoreActor: actor));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -83,11 +83,15 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
var location = ChooseEmptyCellNear(collector, unit);
|
var location = ChooseEmptyCellNear(collector, unit);
|
||||||
if (location != null)
|
if (location != null)
|
||||||
{
|
{
|
||||||
w.CreateActor(unit, new TypeDictionary
|
var actor = w.CreateActor(unit, new TypeDictionary
|
||||||
{
|
{
|
||||||
new LocationInit(location.Value),
|
new LocationInit(location.Value),
|
||||||
new OwnerInit(info.Owner ?? collector.Owner.InternalName)
|
new OwnerInit(info.Owner ?? collector.Owner.InternalName)
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Set the subcell and make sure to crush actors beneath.
|
||||||
|
var positionable = actor.OccupiesSpace as IPositionable;
|
||||||
|
positionable.SetPosition(actor, location.Value, positionable.GetAvailableSubCell(location.Value, ignoreActor: actor));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user