Fix Cargo>EjectOnDeath crash with multipile INotifyBlockingMove
This commit is contained in:
committed by
abcdefg30
parent
c983dda077
commit
1977e64e07
@@ -384,8 +384,8 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
if (!inAir && positionable.CanEnterCell(self.Location, self, false))
|
if (!inAir && positionable.CanEnterCell(self.Location, self, false))
|
||||||
{
|
{
|
||||||
self.World.AddFrameEndTask(w => w.Add(passenger));
|
self.World.AddFrameEndTask(w => w.Add(passenger));
|
||||||
var nbm = passenger.TraitOrDefault<INotifyBlockingMove>();
|
var nbms = passenger.TraitsImplementing<INotifyBlockingMove>();
|
||||||
if (nbm != null)
|
foreach (var nbm in nbms)
|
||||||
nbm.OnNotifyBlockingMove(passenger, passenger);
|
nbm.OnNotifyBlockingMove(passenger, passenger);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user