Skip to content

Commit a3dcc1e

Browse files
committed
bugfix(weapon): fix patriot assist system extended range bug
1 parent 5de3d63 commit a3dcc1e

File tree

4 files changed

+16
-0
lines changed

4 files changed

+16
-0
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3286,6 +3286,8 @@ void AIUpdateInterface::privateAttackObject( Object *victim, Int maxShotsToFire,
32863286

32873287
if (!victim)
32883288
{
3289+
// TheSuperHackers @bugfix bobtista Reset weapons lock to fix patriot turret extended range bug
3290+
getObject()->releaseWeaponLock(LOCKED_TEMPORARILY);
32893291
// Hard to kill em if they're already dead. jba
32903292
return;
32913293
}
@@ -3305,6 +3307,8 @@ void AIUpdateInterface::privateAttackObject( Object *victim, Int maxShotsToFire,
33053307
void AIUpdateInterface::privateForceAttackObject( Object *victim, Int maxShotsToFire, CommandSourceType cmdSource )
33063308
{
33073309
if (!victim) {
3310+
// TheSuperHackers @bugfix bobtista Reset weapons lock to fix patriot turret extended range bug
3311+
getObject()->releaseWeaponLock(LOCKED_TEMPORARILY);
33083312
return;
33093313
}
33103314

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2746,6 +2746,10 @@ static void makeAssistanceRequest( Object *requestOf, void *userData )
27462746
if( requestOf == requestData->m_requestingObject )
27472747
return;
27482748

2749+
// TheSuperHackers @bugfix bobtista Prevent patriot from assisting when it is the target
2750+
if( requestOf == requestData->m_victimObject )
2751+
return;
2752+
27492753
// Only request of our kind of people
27502754
if( !requestOf->getTemplate()->isEquivalentTo( requestData->m_requestingObject->getTemplate() ) )
27512755
return;

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3427,6 +3427,8 @@ void AIUpdateInterface::privateAttackObject( Object *victim, Int maxShotsToFire,
34273427

34283428
if (!victim)
34293429
{
3430+
// TheSuperHackers @bugfix bobtista Reset weapons lock to fix patriot turret extended range bug
3431+
getObject()->releaseWeaponLock(LOCKED_TEMPORARILY);
34303432
// Hard to kill em if they're already dead. jba
34313433
return;
34323434
}
@@ -3446,6 +3448,8 @@ void AIUpdateInterface::privateAttackObject( Object *victim, Int maxShotsToFire,
34463448
void AIUpdateInterface::privateForceAttackObject( Object *victim, Int maxShotsToFire, CommandSourceType cmdSource )
34473449
{
34483450
if (!victim) {
3451+
// TheSuperHackers @bugfix bobtista Reset weapons lock to fix patriot turret extended range bug
3452+
getObject()->releaseWeaponLock(LOCKED_TEMPORARILY);
34493453
return;
34503454
}
34513455

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2957,6 +2957,10 @@ static void makeAssistanceRequest( Object *requestOf, void *userData )
29572957
if( requestOf == requestData->m_requestingObject )
29582958
return;
29592959

2960+
// TheSuperHackers @bugfix bobtista Prevent patriot from assisting when it is the target
2961+
if( requestOf == requestData->m_victimObject )
2962+
return;
2963+
29602964
// Only request of our kind of people
29612965
if( !requestOf->getTemplate()->isEquivalentTo( requestData->m_requestingObject->getTemplate() ) )
29622966
return;

0 commit comments

Comments
 (0)