HomeWildfire Games

Fix hero selection rings becoming unsaturated when moving. Patch by Sandarac…
AuditedrP19732

Description

Fix hero selection rings becoming unsaturated when moving. Patch by Sandarac, refs r16274, #2627.

Differential Revision: https://code.wildfiregames.com/D563

Event Timeline

elexis raised a concern with this commit.Jun 5 2017, 2:02 PM
elexis added a subscriber: elexis.

InvalidateStaticOverlay(); is not called anymore if (!m_AlwaysVisible) and there is no reason provided in D563.
The reason stated in irc (buildings can't change position) is an assumption, but this would need a hard proof as there can be reasons other than direct move commands that causes a position change.
Not only mods and trigger scripts might do unconventional things,
the unit could be moved out of world as mentioned by the according comment in CCmpPosition.cpp:

	 * This must be called after changing anything that will affect the
	 * return value of GetPosition2D() or GetRotation().Y:
	 *  - m_InWorld
	 *  - m_X, m_Z
	 *  - m_RotY

In ICmpSelectable.h we have this comment:

		/// A more complex textured line overlay, composed of several textured line segments. Intended for entities that do not
		/// move often, such as buildings (structures).
		STATIC_OUTLINE,

Adding the InvalidateStaticOverlay() call isn't causing any performance issues as it only SAFE_DELETEs a member. If it's not a static overlay, this will always be null. If it is a static overlay, it must be called.

/ps/trunk/source/simulation2/components/CCmpSelectable.cpp
391

(If the second check is done first, we can avoid one inWorld check.)
(m_Color.a = m_AlphaMin could be moved to a separate line if one wanted to)

This commit now has outstanding concerns.Jun 5 2017, 2:02 PM
elexis added a comment.Jun 7 2017, 6:43 PM

An even better reason to fix this would be that we can move buildings in atlas

elexis accepted this commit.Jul 5 2017, 3:42 PM

thanks for the fix rP19777 (of the fix (rP19732) of the fix (rP16274))

All concerns with this commit have now been addressed.Jul 5 2017, 3:42 PM