Added OwnerLostAction
Allows customisation of what will happen to an actor when its owner loses.
This commit is contained in:
committed by
Paul Chote
parent
0d23070c8e
commit
367a7f617c
@@ -70,8 +70,8 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
public void OnPlayerLost(Player player)
|
||||
{
|
||||
foreach (var a in player.World.Actors.Where(a => a.Owner == player))
|
||||
a.Kill(a);
|
||||
foreach (var a in player.World.ActorsWithTrait<INotifyOwnerLost>().Where(a => a.Actor.Owner == player))
|
||||
a.Trait.OnOwnerLost(a.Actor);
|
||||
|
||||
if (info.SuppressNotifications)
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user