Skip to content

Commit 0b39c14

Browse files
committed
feat(welder): keep weld direction on sudden weld interrupt
1 parent 64256f4 commit 0b39c14

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

src/game/shared/swarm/asw_weapon_welder_shared.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -609,7 +609,11 @@ bool CASW_Weapon_Welder::OffhandActivate()
609609
#ifdef GAME_DLL
610610
pMarine->OnWeldStarted();
611611
#endif
612-
if ( fSealAmount == 0.0f || ( bRecommendedSeal && fSealAmount < 1.0f ) )
612+
if ( pDoor == m_pPrevDoor && m_iAutomaticWeldDirection != 0 )
613+
{
614+
// keep direction
615+
}
616+
else if ( fSealAmount == 0.0f || ( bRecommendedSeal && fSealAmount < 1.0f ) )
613617
{
614618
m_iAutomaticWeldDirection = 1;
615619
}
@@ -625,6 +629,8 @@ bool CASW_Weapon_Welder::OffhandActivate()
625629
m_iAutomaticWeldDirection = -m_iAutomaticWeldDirection;
626630
}
627631

632+
m_pPrevDoor = pDoor;
633+
628634
return true;
629635
}
630636

src/game/shared/swarm/asw_weapon_welder_shared.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ class CASW_Weapon_Welder : public CASW_Weapon
7373
CSoundPatch* m_pWeldingSound;
7474
bool m_bPlayingWelderSound;
7575

76+
CASW_Door* m_pPrevDoor = NULL;
7677
int m_iAutomaticWeldDirection; // -1 = cut +1 = seal
7778

7879
// Classification

0 commit comments

Comments
 (0)