Make ProductionParadrop and ProductionAirdrop refund undelivered actors
This commit is contained in:
@@ -87,7 +87,10 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
owner.World.AddFrameEndTask(w =>
|
owner.World.AddFrameEndTask(w =>
|
||||||
{
|
{
|
||||||
if (!self.IsInWorld || self.IsDead)
|
if (!self.IsInWorld || self.IsDead)
|
||||||
|
{
|
||||||
|
owner.PlayerActor.Trait<PlayerResources>().GiveCash(refundableValue);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var actor = w.CreateActor(info.ActorType, new TypeDictionary
|
var actor = w.CreateActor(info.ActorType, new TypeDictionary
|
||||||
{
|
{
|
||||||
@@ -101,7 +104,10 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
actor.QueueActivity(new CallFunc(() =>
|
actor.QueueActivity(new CallFunc(() =>
|
||||||
{
|
{
|
||||||
if (!self.IsInWorld || self.IsDead)
|
if (!self.IsInWorld || self.IsDead)
|
||||||
|
{
|
||||||
|
owner.PlayerActor.Trait<PlayerResources>().GiveCash(refundableValue);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
foreach (var cargo in self.TraitsImplementing<INotifyDelivery>())
|
foreach (var cargo in self.TraitsImplementing<INotifyDelivery>())
|
||||||
cargo.Delivered(self);
|
cargo.Delivered(self);
|
||||||
|
|||||||
@@ -69,7 +69,10 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
owner.World.AddFrameEndTask(w =>
|
owner.World.AddFrameEndTask(w =>
|
||||||
{
|
{
|
||||||
if (!self.IsInWorld || self.IsDead)
|
if (!self.IsInWorld || self.IsDead)
|
||||||
|
{
|
||||||
|
owner.PlayerActor.Trait<PlayerResources>().GiveCash(refundableValue);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var altitude = self.World.Map.Rules.Actors[actorType].TraitInfo<AircraftInfo>().CruiseAltitude;
|
var altitude = self.World.Map.Rules.Actors[actorType].TraitInfo<AircraftInfo>().CruiseAltitude;
|
||||||
var actor = w.CreateActor(actorType, new TypeDictionary
|
var actor = w.CreateActor(actorType, new TypeDictionary
|
||||||
@@ -83,7 +86,10 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
actor.QueueActivity(new CallFunc(() =>
|
actor.QueueActivity(new CallFunc(() =>
|
||||||
{
|
{
|
||||||
if (!self.IsInWorld || self.IsDead)
|
if (!self.IsInWorld || self.IsDead)
|
||||||
|
{
|
||||||
|
owner.PlayerActor.Trait<PlayerResources>().GiveCash(refundableValue);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
foreach (var cargo in self.TraitsImplementing<INotifyDelivery>())
|
foreach (var cargo in self.TraitsImplementing<INotifyDelivery>())
|
||||||
cargo.Delivered(self);
|
cargo.Delivered(self);
|
||||||
|
|||||||
Reference in New Issue
Block a user