Skip to content

Conversation

@Stubbjax
Copy link

@Stubbjax Stubbjax commented Dec 9, 2025

Closes #1919

This change adjusts income text, veterancy animations and weapon effect conditions so that they play irrespective of an object's drawable / rendering state or being within the view frustum.

Bomb Truck effects now consistently play during their disguise transition states for other players as an added bonus. See #1919 for more information.

@Stubbjax Stubbjax self-assigned this Dec 9, 2025
@Stubbjax Stubbjax added Bug Something is not working right, typically is user facing Minor Severity: Minor < Major < Critical < Blocker Gen Relates to Generals ZH Relates to Zero Hour ThisProject The issue was introduced by this project, or this task is specific to this project labels Dec 9, 2025
if (TheControlBar->isObserverControlBarOn())
{
const Player* observedPlayer = TheControlBar->getObserverLookAtPlayer();
if (!observedPlayer || !observedPlayer->isPlayerActive())
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this test really necessary? If this was missing, what would be broken?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The isPlayerActive check? This ensures that the respective effects are still shown if the observer is viewing a dead player, in which case everything is visible (shroud, stealth, etc.) as if the player is not viewing anyone.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I took another look at rts::localPlayerIsObserving() and removed it again with #2002.

if (obj->isKindOf(KINDOF_DISGUISER))
return true;

if (obj->testStatus(OBJECT_STATUS_STEALTHED) && !obj->testStatus(OBJECT_STATUS_DETECTED))
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe combine this as

if (!obj->isKindOf(KINDOF_DISGUISER)
  && obj->testStatus(OBJECT_STATUS_STEALTHED)
  && !obj->testStatus(OBJECT_STATUS_DETECTED))

because I suspect these guys belong together?

if (rts::localPlayerIsObserving())
{
const Player* observedPlayer = TheControlBar->getObserverLookAtPlayer();
if (!observedPlayer || !observedPlayer->isPlayerActive())
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we perhaps remove this whole thing and instead do:

if (...)
		const Player* player = rts::getObservedOrLocalPlayer();
		const Relationship relationship = player->getRelationship(getTeam());

		if (player->isActivePlayer() && relationship != ALLIES)
			return false;

If I am not mistaken this would guarantee that it does the relationship check only with alive player and therefore simplify the logic.

And maybe the isLocallyViewed() test will also be implicitly redundant then.

void setCustomIndicatorColor(Color c);
void removeCustomIndicatorColor();

Bool isLogicallyVisible() const; ///< Returns whether the object is logically visible to the player.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest also clarify that this does not consider shroud, which is an important factor.

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

Labels

Bug Something is not working right, typically is user facing Gen Relates to Generals Minor Severity: Minor < Major < Critical < Blocker ThisProject The issue was introduced by this project, or this task is specific to this project ZH Relates to Zero Hour

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants