Skip to content

Commit 0c2375e

Browse files
authored
bugfix(input): Prevent invalid interaction feedback for sabotage attempts against sold or under construction buildings (#1459)
1 parent f099e4d commit 0c2375e

8 files changed

+48
-0
lines changed

GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Collide/CrateCollide/SabotageCommandCenterCrateCollide.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,12 @@ Bool SabotageCommandCenterCrateCollide::isValidToExecute( const Object *other )
9797
return FALSE;
9898
}
9999

100+
if (other->getStatusBits().testForAny(MAKE_OBJECT_STATUS_MASK2(OBJECT_STATUS_UNDER_CONSTRUCTION, OBJECT_STATUS_SOLD)))
101+
{
102+
// TheSuperHackers @bugfix Stubbjax 03/08/2025 Can't enter something being sold or under construction.
103+
return FALSE;
104+
}
105+
100106
Relationship r = getObject()->getRelationship( other );
101107
if( r != ENEMIES )
102108
{

GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Collide/CrateCollide/SabotageFakeBuilding.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,12 @@ Bool SabotageFakeBuildingCrateCollide::isValidToExecute( const Object *other ) c
9292
return FALSE;
9393
}
9494

95+
if (other->getStatusBits().testForAny(MAKE_OBJECT_STATUS_MASK2(OBJECT_STATUS_UNDER_CONSTRUCTION, OBJECT_STATUS_SOLD)))
96+
{
97+
// TheSuperHackers @bugfix Stubbjax 03/08/2025 Can't enter something being sold or under construction.
98+
return FALSE;
99+
}
100+
95101
Relationship r = getObject()->getRelationship( other );
96102
if( r != ENEMIES )
97103
{

GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Collide/CrateCollide/SabotageInternetCenterCrateCollide.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,12 @@ Bool SabotageInternetCenterCrateCollide::isValidToExecute( const Object *other )
9898
return FALSE;
9999
}
100100

101+
if (other->getStatusBits().testForAny(MAKE_OBJECT_STATUS_MASK2(OBJECT_STATUS_UNDER_CONSTRUCTION, OBJECT_STATUS_SOLD)))
102+
{
103+
// TheSuperHackers @bugfix Stubbjax 03/08/2025 Can't enter something being sold or under construction.
104+
return FALSE;
105+
}
106+
101107
Relationship r = getObject()->getRelationship( other );
102108
if( r != ENEMIES )
103109
{

GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Collide/CrateCollide/SabotageMilitaryFactoryCrateCollide.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,12 @@ Bool SabotageMilitaryFactoryCrateCollide::isValidToExecute( const Object *other
102102
return FALSE;
103103
}
104104

105+
if (other->getStatusBits().testForAny(MAKE_OBJECT_STATUS_MASK2(OBJECT_STATUS_UNDER_CONSTRUCTION, OBJECT_STATUS_SOLD)))
106+
{
107+
// TheSuperHackers @bugfix Stubbjax 03/08/2025 Can't enter something being sold or under construction.
108+
return FALSE;
109+
}
110+
105111
Relationship r = getObject()->getRelationship( other );
106112
if( r != ENEMIES )
107113
{

GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Collide/CrateCollide/SabotagePowerPlantCrateCollide.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,12 @@ Bool SabotagePowerPlantCrateCollide::isValidToExecute( const Object *other ) con
9292
return FALSE;
9393
}
9494

95+
if (other->getStatusBits().testForAny(MAKE_OBJECT_STATUS_MASK2(OBJECT_STATUS_UNDER_CONSTRUCTION, OBJECT_STATUS_SOLD)))
96+
{
97+
// TheSuperHackers @bugfix Stubbjax 03/08/2025 Can't enter something being sold or under construction.
98+
return FALSE;
99+
}
100+
95101
Relationship r = getObject()->getRelationship( other );
96102
if( r != ENEMIES )
97103
{

GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Collide/CrateCollide/SabotageSuperweaponCrateCollide.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,12 @@ Bool SabotageSuperweaponCrateCollide::isValidToExecute( const Object *other ) co
9797
return FALSE;
9898
}
9999

100+
if (other->getStatusBits().testForAny(MAKE_OBJECT_STATUS_MASK2(OBJECT_STATUS_UNDER_CONSTRUCTION, OBJECT_STATUS_SOLD)))
101+
{
102+
// TheSuperHackers @bugfix Stubbjax 03/08/2025 Can't enter something being sold or under construction.
103+
return FALSE;
104+
}
105+
100106
Relationship r = getObject()->getRelationship( other );
101107
if( r != ENEMIES )
102108
{

GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Collide/CrateCollide/SabotageSupplyCenterCrateCollide.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,12 @@ Bool SabotageSupplyCenterCrateCollide::isValidToExecute( const Object *other ) c
9696
return FALSE;
9797
}
9898

99+
if (other->getStatusBits().testForAny(MAKE_OBJECT_STATUS_MASK2(OBJECT_STATUS_UNDER_CONSTRUCTION, OBJECT_STATUS_SOLD)))
100+
{
101+
// TheSuperHackers @bugfix Stubbjax 03/08/2025 Can't enter something being sold or under construction.
102+
return FALSE;
103+
}
104+
99105
Relationship r = getObject()->getRelationship( other );
100106
if( r != ENEMIES )
101107
{

GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Collide/CrateCollide/SabotageSupplyDropzoneCrateCollide.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,12 @@ Bool SabotageSupplyDropzoneCrateCollide::isValidToExecute( const Object *other )
9696
return FALSE;
9797
}
9898

99+
if (other->getStatusBits().testForAny(MAKE_OBJECT_STATUS_MASK2(OBJECT_STATUS_UNDER_CONSTRUCTION, OBJECT_STATUS_SOLD)))
100+
{
101+
// TheSuperHackers @bugfix Stubbjax 03/08/2025 Can't enter something being sold or under construction.
102+
return FALSE;
103+
}
104+
99105
Relationship r = getObject()->getRelationship( other );
100106
if( r != ENEMIES )
101107
{

0 commit comments

Comments
 (0)