Make Exit Conditional

This commit is contained in:
Mustafa Alperen Seki
2018-10-08 20:45:38 +00:00
committed by Paul Chote
parent 47c4be9191
commit faa35946b8
5 changed files with 35 additions and 28 deletions

View File

@@ -750,8 +750,8 @@ namespace OpenRA.Mods.Common.Traits
Action enter = () =>
{
var exit = targetActor.Info.FirstExitOrDefault(null);
var offset = (exit != null) ? exit.SpawnOffset : WVec.Zero;
var exit = targetActor.FirstExitOrDefault(null);
var offset = exit != null ? exit.Info.SpawnOffset : WVec.Zero;
self.QueueActivity(new HeliFly(self, Target.FromPos(targetActor.CenterPosition + offset)));
self.QueueActivity(new Turn(self, Info.InitialFacing));