fix crash with idle units and pathdebug
This commit is contained in:
@@ -160,11 +160,12 @@ namespace OpenRA.Traits
|
|||||||
{
|
{
|
||||||
if (!Game.world.LocalPlayer.PlayerActor.Trait<DeveloperMode>().PathDebug) return;
|
if (!Game.world.LocalPlayer.PlayerActor.Trait<DeveloperMode>().PathDebug) return;
|
||||||
|
|
||||||
|
var activity = self.GetCurrentActivity();
|
||||||
var mobile = self.TraitOrDefault<IMove>();
|
var mobile = self.TraitOrDefault<IMove>();
|
||||||
if (mobile != null)
|
if (activity != null && mobile != null)
|
||||||
{
|
{
|
||||||
var alt = new float2(0, -mobile.Altitude);
|
var alt = new float2(0, -mobile.Altitude);
|
||||||
var path = self.GetCurrentActivity().GetCurrentPath();
|
var path = activity.GetCurrentPath();
|
||||||
var start = self.CenterLocation + alt;
|
var start = self.CenterLocation + alt;
|
||||||
|
|
||||||
var c = Color.Green;
|
var c = Color.Green;
|
||||||
|
|||||||
Reference in New Issue
Block a user