Add CargoCondition(s) to Passenger
This commit is contained in:
committed by
Paul Chote
parent
3febae1644
commit
6c5c4a129f
@@ -281,6 +281,9 @@ namespace OpenRA.Mods.Common.Traits
|
||||
foreach (var npe in self.TraitsImplementing<INotifyPassengerExited>())
|
||||
npe.OnPassengerExited(self, a);
|
||||
|
||||
foreach (var nec in a.TraitsImplementing<INotifyExitedCargo>())
|
||||
nec.OnExitedCargo(a, self);
|
||||
|
||||
var p = a.Trait<Passenger>();
|
||||
p.Transport = null;
|
||||
|
||||
@@ -347,9 +350,14 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
// If not initialized then this will be notified in the first tick
|
||||
if (initialized)
|
||||
{
|
||||
foreach (var npe in self.TraitsImplementing<INotifyPassengerEntered>())
|
||||
npe.OnPassengerEntered(self, a);
|
||||
|
||||
foreach (var nec in a.TraitsImplementing<INotifyEnteredCargo>())
|
||||
nec.OnEnteredCargo(a, self);
|
||||
}
|
||||
|
||||
var p = a.Trait<Passenger>();
|
||||
p.Transport = self;
|
||||
|
||||
@@ -446,6 +454,9 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
foreach (var npe in self.TraitsImplementing<INotifyPassengerEntered>())
|
||||
npe.OnPassengerEntered(self, c);
|
||||
|
||||
foreach (var nec in c.TraitsImplementing<INotifyEnteredCargo>())
|
||||
nec.OnEnteredCargo(c, self);
|
||||
}
|
||||
|
||||
initialized = true;
|
||||
|
||||
Reference in New Issue
Block a user