Skip to content

Commit c8c644d

Browse files
committed
bugfix(weapon): fix patriot assist system extended range bug
1 parent b878990 commit c8c644d

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
@@ -2756,6 +2756,10 @@ static void makeAssistanceRequest( Object *requestOf, void *userData )
27562756
if( requestOf == requestData->m_requestingObject )
27572757
return;
27582758

2759+
// TheSuperHackers @bugfix bobtista Prevent patriot from assisting when it is the target
2760+
if( requestOf == requestData->m_victimObject )
2761+
return;
2762+
27592763
// Only request of our kind of people
27602764
if( !requestOf->getTemplate()->isEquivalentTo( requestData->m_requestingObject->getTemplate() ) )
27612765
return;

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

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

34243424
if (!victim)
34253425
{
3426+
// TheSuperHackers @bugfix bobtista Reset weapons lock to fix patriot turret extended range bug
3427+
getObject()->releaseWeaponLock(LOCKED_TEMPORARILY);
34263428
// Hard to kill em if they're already dead. jba
34273429
return;
34283430
}
@@ -3442,6 +3444,8 @@ void AIUpdateInterface::privateAttackObject( Object *victim, Int maxShotsToFire,
34423444
void AIUpdateInterface::privateForceAttackObject( Object *victim, Int maxShotsToFire, CommandSourceType cmdSource )
34433445
{
34443446
if (!victim) {
3447+
// TheSuperHackers @bugfix bobtista Reset weapons lock to fix patriot turret extended range bug
3448+
getObject()->releaseWeaponLock(LOCKED_TEMPORARILY);
34453449
return;
34463450
}
34473451

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

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

2970+
// TheSuperHackers @bugfix bobtista Prevent patriot from assisting when it is the target
2971+
if( requestOf == requestData->m_victimObject )
2972+
return;
2973+
29702974
// Only request of our kind of people
29712975
if( !requestOf->getTemplate()->isEquivalentTo( requestData->m_requestingObject->getTemplate() ) )
29722976
return;

0 commit comments

Comments
 (0)