fixed #2198 - crates are collected when landing on top of a unit
This commit is contained in:
@@ -24,7 +24,7 @@ namespace OpenRA.Mods.RA
|
||||
}
|
||||
|
||||
// ITeleportable is required for paradrop
|
||||
class Crate : ITick, IOccupySpace, ITeleportable, ICrushable, ISync
|
||||
class Crate : ITick, IOccupySpace, ITeleportable, ICrushable, ISync, INotifyParachuteLanded
|
||||
{
|
||||
readonly Actor self;
|
||||
[Sync] int ticks;
|
||||
@@ -62,6 +62,15 @@ namespace OpenRA.Mods.RA
|
||||
n -= s.Second;
|
||||
}
|
||||
|
||||
public void OnLanded()
|
||||
{
|
||||
var landedOn = self.World.ActorMap.GetUnitsAt(self.Location)
|
||||
.FirstOrDefault(a => a != self);
|
||||
|
||||
if (landedOn != null)
|
||||
OnCrush(landedOn);
|
||||
}
|
||||
|
||||
public void Tick(Actor self)
|
||||
{
|
||||
if( ++ticks >= Info.Lifetime * 25 )
|
||||
|
||||
Reference in New Issue
Block a user