Skip to content

Commit 1640915

Browse files
committed
feat(welder): add StopCloseForWeld
1 parent 7841665 commit 1640915

3 files changed

Lines changed: 18 additions & 0 deletions

File tree

src/game/server/swarm/asw_door.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1082,6 +1082,18 @@ bool CASW_Door::CloseForWeld( CASW_Marine *pMarine )
10821082
return false;
10831083
}
10841084

1085+
bool CASW_Door::StopCloseForWeld( CASW_Marine *pMarine )
1086+
{
1087+
if ( m_bCanCloseToWeld && gpGlobals->curtime < m_fClosingToWeldTime )
1088+
{
1089+
variant_t emptyVariant;
1090+
AcceptInput( "Open", pMarine, this, emptyVariant, 0 );
1091+
m_fClosingToWeldTime = gpGlobals->curtime;
1092+
return true;
1093+
}
1094+
return false;
1095+
}
1096+
10851097
void CASW_Door::AutoOpen( CBaseEntity *pOther )
10861098
{
10871099
if ( gpGlobals->curtime > m_fClosingToWeldTime )

src/game/server/swarm/asw_door.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ class CASW_Door : public CBasePropDoor
9595
Vector GetWeldFacingPoint(CBaseEntity* pOther); // the point a marine should look to weld this door
9696

9797
bool CloseForWeld(CASW_Marine* PMarine); // player requests the door to shut so he can weld it
98+
bool StopCloseForWeld(CASW_Marine *pMarine); // open the door
9899
bool IsRecommendedSeal( void ) { return m_bRecommendedSeal; }
99100
bool CanWeld( void ) { return m_bCanCloseToWeld; }
100101
float m_fClosingToWeldTime; // door won't autoopen before this curtime

src/game/shared/swarm/asw_weapon_welder_shared.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,11 @@ void CASW_Weapon_Welder::WeldDoor(bool bSeal)
172172
{
173173
pDoor->CloseForWeld( pMarine ); // shut the door first, so we can start welding it
174174
}
175+
else
176+
{
177+
pDoor->StopCloseForWeld( pMarine );
178+
bWelding = false;
179+
}
175180
#endif
176181
}
177182
else

0 commit comments

Comments
 (0)