From 25a0143b46973a855880b8b82dd4a6a8f6802606 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Sat, 29 Aug 2015 18:58:30 +0200 Subject: [PATCH] avoid unnecessary trait lookups --- OpenRA.Mods.Common/Traits/BodyOrientation.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/OpenRA.Mods.Common/Traits/BodyOrientation.cs b/OpenRA.Mods.Common/Traits/BodyOrientation.cs index c15462f434..92c407f394 100644 --- a/OpenRA.Mods.Common/Traits/BodyOrientation.cs +++ b/OpenRA.Mods.Common/Traits/BodyOrientation.cs @@ -73,12 +73,11 @@ namespace OpenRA.Mods.Common.Traits return info.QuantizedFacings; var qboi = self.Info.Traits.GetOrDefault(); - var isb = self.HasTrait(); // If a sprite actor has neither custom QuantizedFacings nor a trait implementing IQuantizeBodyOrientationInfo, throw if (qboi == null) { - if (isb) + if (self.HasTrait()) throw new InvalidOperationException("Actor" + self.Info.Name + "has a sprite body but no facing quantization." + " Either add the QuantizeFacingsFromSequence trait or set custom QuantizedFacings on BodyOrientation."); else