New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Neutral structures can not be targeted under explored map fog (playtest-20190209) #16190

Open
dragunoff opened this Issue Feb 10, 2019 · 5 comments

Comments

Projects
None yet
3 participants
@dragunoff
Copy link
Contributor

dragunoff commented Feb 10, 2019

There is no target cursor for neutral structures under fog when starting a game with Explored map: On. If the structure is revealed and then goes under fog again, the cursor does appear.

To reproduce:

  • Start a skirmish game on map with neutral capture-able structures (for example: Green Belt) with Explored map: On
  • Build an engineer or any unit that can attack
  • Try ordering the engie to capture the structure or try force firing with the attacking unit under fog w/o having revealed that part of the map

screenshot_20190210_125554

@pchote

This comment has been minimized.

Copy link
Member

pchote commented Feb 10, 2019

From #16189:

Repro case: Start a game with explored map enabled and without enabling the visibility cheat build an engineer and see that tech structures do not have a cursor. If there is a map specific component, my repro case was on the left-hand spawn on Sidestep.

I always used the /all cheat when testing, which hides this regression.

@obrakmann

This comment has been minimized.

Copy link
Contributor

obrakmann commented Feb 10, 2019

The problem seems to be that while the actor's FrozenState.Visible flag gets set properly during creation, it gets reset to false right in the first tick.

@obrakmann

This comment has been minimized.

Copy link
Contributor

obrakmann commented Feb 10, 2019

Introduced in 95dc9cb, #16168

@obrakmann

This comment has been minimized.

Copy link
Contributor

obrakmann commented Feb 10, 2019

Proposed fix below. I don't have the foggiest idea whether that's in any way correct, though.

diff --git a/OpenRA.Mods.Common/Traits/Modifiers/FrozenUnderFog.cs b/OpenRA.Mods
index 7897c6b83b..eb1ce5abba 100644
--- a/OpenRA.Mods.Common/Traits/Modifiers/FrozenUnderFog.cs
+++ b/OpenRA.Mods.Common/Traits/Modifiers/FrozenUnderFog.cs
@@ -123,7 +123,7 @@ public bool IsVisible(Actor self, Player byPlayer)
 
                void ITick.Tick(Actor self)
                {
-                       if (self.Disposed)
+                       if (self.Disposed || !created)
                                return;
 
                        VisibilityHash = 0;
@pchote

This comment has been minimized.

Copy link
Member

pchote commented Feb 10, 2019

Oh, I see...

I think a better fix will be to get rid of the FrameEndTask, and instead move the if (startsRevealed) block into Tick.

@obrakmann obrakmann referenced a pull request that will close this issue Feb 10, 2019

Open

Fix pre-placed frozen actors not being targetable #16194

@obrakmann obrakmann self-assigned this Feb 10, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment