Fix WithShadow

It *modifies* the actor rendering, so returning an empty renderable was bogus, as were the IsInWorld/IsDead checks.
This commit is contained in:
reaperrr
2017-08-31 16:01:20 +02:00
committed by Matthias Mailänder
parent 69251d508b
commit d1a4133752

View File

@@ -43,10 +43,7 @@ namespace OpenRA.Mods.Common.Traits.Render
public IEnumerable<IRenderable> ModifyRender(Actor self, WorldRenderer wr, IEnumerable<IRenderable> r) public IEnumerable<IRenderable> ModifyRender(Actor self, WorldRenderer wr, IEnumerable<IRenderable> r)
{ {
if (IsTraitDisabled) if (IsTraitDisabled)
return Enumerable.Empty<IRenderable>(); return r;
if (self.IsDead || !self.IsInWorld)
return Enumerable.Empty<IRenderable>();
// Contrails shouldn't cast shadows // Contrails shouldn't cast shadows
var height = self.World.Map.DistanceAboveTerrain(self.CenterPosition).Length; var height = self.World.Map.DistanceAboveTerrain(self.CenterPosition).Length;