Provides automatic installation scripts for OpenRA with Tiberian Sun & Red Alert 2 + Dune 2 (Windows, Linux)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

47 lines
1.4 KiB

  1. --- a/OpenRA.Mods.RA2/Traits/Render/WithExitOverlay.cs
  2. +++ b/OpenRA.Mods.RA2/Traits/Render/WithExitOverlay.cs
  3. @@ -36,13 +36,18 @@
  4. public object Create(ActorInitializer init) { return new WithExitOverlay(init.Self, this); }
  5. }
  6. - public class WithExitOverlay : INotifyDamageStateChanged, INotifyBuildComplete, INotifySold, INotifyProduction, ITick
  7. + public class WithExitOverlay : INotifyDamageStateChanged, INotifyBuildComplete, INotifySold, INotifyProduction
  8. {
  9. readonly Actor self;
  10. readonly Animation overlay;
  11. - bool buildComplete, enable;
  12. + bool buildComplete;
  13. CPos exit;
  14. + bool IsExitBlocked
  15. + {
  16. + get { return self.World.ActorMap.GetActorsAt(exit).Any(a => a != self); }
  17. + }
  18. +
  19. public WithExitOverlay(Actor self, WithExitOverlayInfo info)
  20. {
  21. this.self = self;
  22. @@ -56,7 +61,7 @@
  23. var anim = new AnimationWithOffset(overlay,
  24. () => body.LocalToWorld(info.Offset.Rotate(body.QuantizeOrientation(self, self.Orientation))),
  25. - () => !buildComplete || !enable);
  26. + () => !buildComplete || !IsExitBlocked);
  27. rs.Add(anim, info.Palette, info.IsPlayerPalette);
  28. }
  29. @@ -80,13 +85,6 @@
  30. public void UnitProduced(Actor self, Actor other, CPos exit)
  31. {
  32. this.exit = exit;
  33. - enable = true;
  34. - }
  35. -
  36. - public void Tick(Actor self)
  37. - {
  38. - if (enable)
  39. - enable = self.World.ActorMap.GetActorsAt(exit).Any(a => a != self);
  40. }
  41. }
  42. }
  43. \ No newline at end of file