Move DeployTransform logic into its own method, and remove its CancelActivity call so it works properly when queued
This commit is contained in:
@@ -68,9 +68,7 @@ namespace OpenRA.Mods.RA
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ResolveOrder( Actor self, Order order )
|
public void DeployTransform()
|
||||||
{
|
|
||||||
if (order.OrderString == "DeployTransform")
|
|
||||||
{
|
{
|
||||||
var b = self.TraitOrDefault<Building>();
|
var b = self.TraitOrDefault<Building>();
|
||||||
|
|
||||||
@@ -80,7 +78,6 @@ namespace OpenRA.Mods.RA
|
|||||||
Sound.PlayToPlayer(self.Owner, s);
|
Sound.PlayToPlayer(self.Owner, s);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
self.CancelActivity();
|
|
||||||
|
|
||||||
if (self.HasTrait<IFacing>())
|
if (self.HasTrait<IFacing>())
|
||||||
self.QueueActivity(new Turn(Info.Facing));
|
self.QueueActivity(new Turn(Info.Facing));
|
||||||
@@ -91,6 +88,11 @@ namespace OpenRA.Mods.RA
|
|||||||
|
|
||||||
self.QueueActivity(new Transform(self, Info.IntoActor) { Offset = (CVec)Info.Offset, Facing = Info.Facing, Sounds = Info.TransformSounds });
|
self.QueueActivity(new Transform(self, Info.IntoActor) { Offset = (CVec)Info.Offset, Facing = Info.Facing, Sounds = Info.TransformSounds });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void ResolveOrder( Actor self, Order order )
|
||||||
|
{
|
||||||
|
if (order.OrderString == "DeployTransform")
|
||||||
|
DeployTransform();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user