-
Notifications
You must be signed in to change notification settings - Fork 126
bugfix: Update visibility conditions for client-side effects #1964
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
base: main
Are you sure you want to change the base?
bugfix: Update visibility conditions for client-side effects #1964
Conversation
| if (TheControlBar->isObserverControlBarOn()) | ||
| { | ||
| const Player* observedPlayer = TheControlBar->getObserverLookAtPlayer(); | ||
| if (!observedPlayer || !observedPlayer->isPlayerActive()) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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)) |
There was a problem hiding this comment.
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()) |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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.
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.