Skip to content

Commit 1501134

Browse files
committed
refactor: Apply new enclosing container visibility logic
1 parent 7e10fcf commit 1501134

File tree

7 files changed

+7
-9
lines changed

7 files changed

+7
-9
lines changed

Generals/Code/GameEngine/Source/GameLogic/Object/Object.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2833,7 +2833,7 @@ void Object::onVeterancyLevelChanged( VeterancyLevel oldLevel, VeterancyLevel ne
28332833
Bool doAnimation = provideFeedback
28342834
&& newLevel > oldLevel
28352835
&& !isKindOf(KINDOF_IGNORED_IN_GUI)
2836-
&& getDrawable()->isVisible();
2836+
&& isSelfOrEnclosingContainedByVisible();
28372837

28382838
if( doAnimation && TheGameLogic->getDrawIconUI() )
28392839
{

Generals/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -886,7 +886,7 @@ UnsignedInt WeaponTemplate::fireWeaponTemplate
886886

887887
// TheSuperHackers @todo: Remove hardcoded KINDOF_MINE check and apply PlayFXWhenStealthed = Yes to the mine weapons instead.
888888

889-
if(!sourceObj->getDrawable()->isVisible() // if user watching cannot see us
889+
if(!sourceObj->isSelfOrEnclosingContainedByVisible() // if user watching cannot see us
890890
&& !sourceObj->isKindOf(KINDOF_MINE) // and not a mine (which always do the FX, even if hidden)...
891891
&& !isPlayFXWhenStealthed() // and not a weapon marked to playwhenstealthed
892892
)

GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Object.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3148,7 +3148,7 @@ void Object::onVeterancyLevelChanged( VeterancyLevel oldLevel, VeterancyLevel ne
31483148
Bool doAnimation = provideFeedback
31493149
&& newLevel > oldLevel
31503150
&& !isKindOf(KINDOF_IGNORED_IN_GUI)
3151-
&& getDrawable()->isVisible();
3151+
&& isSelfOrEnclosingContainedByVisible();
31523152

31533153
if( doAnimation && TheGameLogic->getDrawIconUI() )
31543154
{

GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/HackInternetAIUpdate.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,7 @@ StateReturnType HackInternetState::update()
543543
//Grant the unit some experience for a successful hack.
544544
xp->addExperiencePoints( ai->getXpPerCashUpdate() );
545545

546-
if (owner->getDrawable()->isVisible())
546+
if (owner->isSelfOrEnclosingContainedByVisible())
547547
{
548548
// OY LOOK! I AM USING LOCAL PLAYER. Do not put anything other than TheInGameUI->addFloatingText in the block this controls!!!
549549
//Display cash income floating over the hacker.

GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AutoDepositUpdate.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@
6363
#include "GameLogic/Module/AutoDepositUpdate.h"
6464
#include "GameLogic/Module/AIUpdate.h"
6565
#include "GameLogic/Object.h"
66-
#include "GameClient/Drawable.h"
6766
#include "GameClient/InGameUI.h"
6867
#include "GameClient/Color.h"
6968
#include "GameClient/GameText.h"
@@ -173,7 +172,7 @@ UpdateSleepTime AutoDepositUpdate::update( void )
173172
getObject()->getControllingPlayer()->getScoreKeeper()->addMoneyEarned( modData->m_depositAmount);
174173
}
175174

176-
if (moneyAmount > 0 && getObject()->getDrawable()->isVisible())
175+
if (moneyAmount > 0 && getObject()->isSelfOrEnclosingContainedByVisible())
177176
{
178177

179178
const Object *owner = getObject();

GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/DockUpdate/SupplyCenterDockUpdate.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
#include "GameLogic/Module/SupplyCenterDockUpdate.h"
3535
#include "GameLogic/Module/SupplyTruckAIUpdate.h"
3636
#include "GameClient/Color.h"
37-
#include "GameClient/Drawable.h"
3837
#include "GameClient/InGameUI.h"
3938
#include "GameClient/GameText.h"
4039

@@ -129,7 +128,7 @@ Bool SupplyCenterDockUpdate::action( Object* docker, Object *drone )
129128
}
130129
}
131130

132-
if (value > 0 && getObject()->getDrawable()->isVisible())
131+
if (value > 0 && getObject()->isSelfOrEnclosingContainedByVisible())
133132
{
134133
// OY LOOK! I AM USING LOCAL PLAYER. Do not put anything other than TheInGameUI->addFloatingText in the block this controls!!!
135134
// Setup info for adding a floating text

GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -917,7 +917,7 @@ UnsignedInt WeaponTemplate::fireWeaponTemplate
917917

918918
// TheSuperHackers @todo: Remove hardcoded KINDOF_MINE check and apply PlayFXWhenStealthed = Yes to the mine weapons instead.
919919

920-
if(!sourceObj->getDrawable()->isVisible() // if user watching cannot see us
920+
if(!sourceObj->isSelfOrEnclosingContainedByVisible() // if user watching cannot see us
921921
&& !sourceObj->isKindOf(KINDOF_MINE) // and not a mine (which always do the FX, even if hidden)...
922922
&& !isPlayFXWhenStealthed() // and not a weapon marked to playwhenstealthed
923923
)

0 commit comments

Comments
 (0)