@@ -106,6 +106,9 @@ class INextBotPlayerInput
106106 virtual void PressReloadButton ( float duration = -1 .0f ) = 0;
107107 virtual void ReleaseReloadButton ( void ) = 0;
108108
109+ virtual void PressDropButton ( float duration = -1 .0f ) = 0;
110+ virtual void ReleaseDropButton ( void ) = 0;
111+
109112 virtual void PressForwardButton ( float duration = -1 .0f ) = 0;
110113 virtual void ReleaseForwardButton ( void ) = 0;
111114
@@ -212,6 +215,9 @@ class NextBotPlayer : public PlayerType, public INextBot, public INextBotPlayerI
212215 virtual void PressReloadButton ( float duration = -1 .0f );
213216 virtual void ReleaseReloadButton ( void );
214217
218+ virtual void PressDropButton ( float duration = -1 .0f );
219+ virtual void ReleaseDropButton ( void );
220+
215221 virtual void PressForwardButton ( float duration = -1 .0f );
216222 virtual void ReleaseForwardButton ( void );
217223
@@ -277,6 +283,7 @@ class NextBotPlayer : public PlayerType, public INextBot, public INextBotPlayerI
277283 CountdownTimer m_specialFireButtonTimer;
278284 CountdownTimer m_useButtonTimer;
279285 CountdownTimer m_reloadButtonTimer;
286+ CountdownTimer m_dropButtonTimer;
280287 CountdownTimer m_forwardButtonTimer;
281288 CountdownTimer m_backwardButtonTimer;
282289 CountdownTimer m_leftButtonTimer;
@@ -430,6 +437,20 @@ inline void NextBotPlayer< PlayerType >::ReleaseReloadButton( void )
430437 m_reloadButtonTimer.Invalidate ();
431438}
432439
440+ template < typename PlayerType >
441+ inline void NextBotPlayer< PlayerType >::PressDropButton( float duration )
442+ {
443+ m_inputButtons |= IN_DROP;
444+ m_dropButtonTimer.Start ( duration );
445+ }
446+
447+ template < typename PlayerType >
448+ inline void NextBotPlayer< PlayerType >::ReleaseDropButton( void )
449+ {
450+ m_inputButtons &= ~IN_DROP;
451+ m_dropButtonTimer.Invalidate ();
452+ }
453+
433454template < typename PlayerType >
434455inline void NextBotPlayer< PlayerType >::PressJumpButton( float duration )
435456{
@@ -631,6 +652,7 @@ inline void NextBotPlayer< PlayerType >::Spawn( void )
631652 m_specialFireButtonTimer.Invalidate ();
632653 m_useButtonTimer.Invalidate ();
633654 m_reloadButtonTimer.Invalidate ();
655+ m_dropButtonTimer.Invalidate ();
634656 m_forwardButtonTimer.Invalidate ();
635657 m_backwardButtonTimer.Invalidate ();
636658 m_leftButtonTimer.Invalidate ();
@@ -758,6 +780,9 @@ inline void NextBotPlayer< PlayerType >::PhysicsSimulate( void )
758780 if ( !m_reloadButtonTimer.IsElapsed () )
759781 m_inputButtons |= IN_RELOAD;
760782
783+ if ( !m_dropButtonTimer.IsElapsed () )
784+ m_inputButtons |= IN_DROP;
785+
761786 if ( !m_forwardButtonTimer.IsElapsed () )
762787 m_inputButtons |= IN_FORWARD;
763788
0 commit comments