save a trait lookup
This commit is contained in:
@@ -64,10 +64,10 @@ namespace OpenRA.Mods.RA.Activities
|
|||||||
self.Trait<IPositionable>().SetPosition(self, destination);
|
self.Trait<IPositionable>().SetPosition(self, destination);
|
||||||
self.Generation++;
|
self.Generation++;
|
||||||
|
|
||||||
if (killCargo && self.HasTrait<Cargo>())
|
if (killCargo)
|
||||||
{
|
{
|
||||||
var cargo = self.Trait<Cargo>();
|
var cargo = self.TraitOrDefault<Cargo>();
|
||||||
if (teleporter != null)
|
if (cargo != null && teleporter != null)
|
||||||
{
|
{
|
||||||
while (!cargo.IsEmpty(self))
|
while (!cargo.IsEmpty(self))
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user