Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion game/neo/scripts/kb_act.lst
Original file line numberDiff line numberDiff line change
Expand Up@@ -47,7 +47,7 @@
"+voicerecord" "#Valve_Use_Voice_Communication"
"messagemode" "#Valve_Chat_Message"
"messagemode2" "#Valve_Team_Message"
"+attack3" "Ping Location"
"+ping" "Ping Location"
"joinstar 0" "Join Alpha Star"
"joinstar 1" "Join Bravo Star"
"joinstar 2" "Join Charlie Star"
Expand Down
2 changes: 1 addition & 1 deletion game/neo/scripts/kb_def.lst
Original file line numberDiff line numberDiff line change
Expand Up@@ -51,6 +51,6 @@
"MWHEELUP" "invnext"
"MOUSE1" "+attack"
"MOUSE2" "+toggle_aim"
"MOUSE3" "+attack3"
"MOUSE3" "+ping"
"PAUSE" "pause"
"`" "neo_toggleconsole"
2 changes: 1 addition & 1 deletion src/game/client/c_baseplayer.cpp
Original file line numberDiff line numberDiff line change
Expand Up@@ -2600,7 +2600,7 @@ void C_BasePlayer::PhysicsSimulate( void )
ctx->cmd.sidemove = 0;
ctx->cmd.upmove = 0;
ctx->cmd.impulse = 0;
ctx->cmd.buttons &= ~(IN_ATTACK | IN_ATTACK2 | IN_ATTACK3 | IN_JUMP | IN_ALT1 | IN_ALT2 | IN_ZOOM);
ctx->cmd.buttons &= ~(IN_ATTACK | IN_ATTACK2 | IN_ATTACK3 | IN_PING | IN_JUMP | IN_ALT1 | IN_ALT2 | IN_ZOOM);
}
else if (static_cast<C_NEO_Player*>(this)->GetNeoFlags() & NEO_FL_FREEZETIME)
{
Expand Down
25 changes: 25 additions & 0 deletions src/game/client/cdll_client_int.cpp
Original file line numberDiff line numberDiff line change
Expand Up@@ -1530,6 +1530,31 @@ void CHLClient::PostInit()
}
}

if (iCfgVerMajor < 34)
{
// Player pings moved off of +attack3 onto their own +ping bind,
// so move whichever key the player had bound to +attack3 over to it.
const ButtonCode_t bcPing = gameuifuncs->GetButtonCodeForBind("+attack3");
if (bcPing > BUTTON_CODE_NONE)
{
const char *bindBtnName = g_pInputSystem->ButtonCodeToString(bcPing);
if (bindBtnName && bindBtnName[0])
{
char szCmd[128];

V_sprintf_safe(szCmd, "unbind \"%s\"\n", bindBtnName);
engine->ClientCmd_Unrestricted(szCmd);

V_sprintf_safe(szCmd, "bind \"%s\" \"+ping\"\n", bindBtnName);
engine->ClientCmd_Unrestricted(szCmd);
}
}
else
{
SetupBindIfNotSet("+ping", MOUSE_MIDDLE); // Ping location
}
}

cvr_cl_neo_cfg_version_major.SetValue(NEO_VERSION_MAJOR);
cvr_cl_neo_cfg_version_minor.SetValue(NEO_VERSION_MINOR);
}
Expand Down
9 changes: 9 additions & 0 deletions src/game/client/in_main.cpp
Original file line numberDiff line numberDiff line change
Expand Up@@ -153,6 +153,7 @@ static kbutton_t in_attack3;
kbutton_t in_ducktoggle;

#ifdef NEO
static kbutton_t in_ping;
static kbutton_t in_drop;
static kbutton_t in_aim;
static kbutton_t in_lean_left;
Expand DownExpand Up@@ -649,6 +650,9 @@ void IN_Attack3Down( const CCommand &args ) { KeyDown(&in_attack3, args[1] );}
void IN_Attack3Up( const CCommand &args ) { KeyUp(&in_attack3, args[1] );}

#ifdef NEO
void IN_PingDown( const CCommand &args ) { KeyDown(&in_ping, args[1] );}
void IN_PingUp( const CCommand &args ) { KeyUp(&in_ping, args[1] );}

void IN_DropUp( const CCommand &args ) { KeyUp( &in_drop, args[1] ); }
void IN_DropDown( const CCommand &args ) { KeyDown( &in_drop, args[1] ); }

Expand DownExpand Up@@ -1726,6 +1730,7 @@ int CInput::GetButtonBits( int bResetState )
CalcButtonBits( bits, IN_ATTACK3, s_ClearInputState, &in_attack3, bResetState );

#ifdef NEO
CalcButtonBits( bits, IN_PING, s_ClearInputState, &in_ping, bResetState );
CalcButtonBits( bits, IN_DROP, s_ClearInputState, &in_drop, bResetState );
CalcButtonBits( bits, IN_AIM, s_ClearInputState, &in_aim, bResetState );
CalcButtonBits( bits, IN_LEAN_LEFT, s_ClearInputState, &in_lean_left, bResetState );
Expand DownExpand Up@@ -1900,6 +1905,10 @@ static ConCommand endgrenade2( "-grenade2", IN_Grenade2Up );
static ConCommand startgrenade2( "+grenade2", IN_Grenade2Down );
static ConCommand startattack3("+attack3", IN_Attack3Down);
static ConCommand endattack3("-attack3", IN_Attack3Up);
#ifdef NEO
static ConCommand startping("+ping", IN_PingDown);
static ConCommand endping("-ping", IN_PingUp);
#endif

#ifdef TF_CLIENT_DLL
static ConCommand toggle_duck( "toggle_duck", IN_DuckToggle );
Expand Down
3 changes: 3 additions & 0 deletions src/game/client/in_steamcontroller.cpp
Original file line numberDiff line numberDiff line change
Expand Up@@ -137,6 +137,9 @@ static ControllerDigitalActionToCommand g_ControllerDigitalGameActions[] =
{ "attack", "+attack", CONTROLLER_ACTION_FLAGS_NONE },
{ "attack2", "+attack2", CONTROLLER_ACTION_FLAGS_NONE },
{ "attack3", "+attack3", CONTROLLER_ACTION_FLAGS_NONE },
#ifdef NEO
{ "ping", "+ping", CONTROLLER_ACTION_FLAGS_NONE },
#endif
{ "jump", "+jump", CONTROLLER_ACTION_FLAGS_STOPS_TAUNT },
{ "use_action_slot_item", "+use_action_slot_item", CONTROLLER_ACTION_FLAGS_NONE },
{ "invprev", "invprev", CONTROLLER_ACTION_FLAGS_STOPS_TAUNT|CONTROLLER_ACTION_FLAGS_NEEDS_DEBOUNCE },
Expand Down
27 changes: 27 additions & 0 deletions src/game/server/NextBot/Player/NextBotPlayer.h
Original file line numberDiff line numberDiff line change
Expand Up@@ -122,6 +122,9 @@ class INextBotPlayerInput
virtual void ReleaseJumpButton( void ) = 0;

#ifdef NEO
virtual void PressPingButton( float duration = -1.0f ) = 0;
virtual void ReleasePingButton( void ) = 0;

virtual void PressDropButton( float duration = -1.0f ) = 0;
virtual void ReleaseDropButton( void ) = 0;

Expand DownExpand Up@@ -216,6 +219,9 @@ class NextBotPlayer : public PlayerType, public INextBot, public INextBotPlayerI
virtual void ReleaseSpecialFireButton( void );

#ifdef NEO
virtual void PressPingButton( float duration = -1.0f );
virtual void ReleasePingButton( void );

virtual void PressDropButton( float duration = -1.0f );
virtual void ReleaseDropButton( void );

Expand DownExpand Up@@ -313,6 +319,7 @@ class NextBotPlayer : public PlayerType, public INextBot, public INextBotPlayerI
CountdownTimer m_walkButtonTimer;
CountdownTimer m_buttonScaleTimer;
#ifdef NEO
CountdownTimer m_pingButtonTimer;
CountdownTimer m_moveUpButtonTimer;
CountdownTimer m_moveDownButtonTimer;
CountdownTimer m_dropButtonTimer;
Expand DownExpand Up@@ -433,6 +440,22 @@ inline void NextBotPlayer< PlayerType >::ReleaseSpecialFireButton( void )
m_specialFireButtonTimer.Invalidate();
}

#ifdef NEO
template < typename PlayerType >
inline void NextBotPlayer< PlayerType >::PressPingButton( float duration )
{
m_inputButtons |= IN_PING;
m_pingButtonTimer.Start( duration );
}

template < typename PlayerType >
inline void NextBotPlayer< PlayerType >::ReleasePingButton( void )
{
m_inputButtons &= ~IN_PING;
m_pingButtonTimer.Invalidate();
}
#endif // NEO

template < typename PlayerType >
inline void NextBotPlayer< PlayerType >::PressUseButton( float duration )
{
Expand DownExpand Up@@ -731,6 +754,7 @@ inline void NextBotPlayer< PlayerType >::Spawn( void )
m_forwardScale = m_rightScale = 0.04;
m_burningTimer.Invalidate();
#ifdef NEO
m_pingButtonTimer.Invalidate();
m_moveUpButtonTimer.Invalidate();
m_moveDownButtonTimer.Invalidate();
m_dropButtonTimer.Invalidate();
Expand DownExpand Up@@ -873,6 +897,9 @@ inline void NextBotPlayer< PlayerType >::PhysicsSimulate( void )
m_inputButtons |= IN_SPEED;

#ifdef NEO
if ( !m_pingButtonTimer.IsElapsed() )
m_inputButtons |= IN_PING;

if ( !m_sneakButtonTimer.IsElapsed() )
m_inputButtons |= IN_WALK;

Expand Down
2 changes: 1 addition & 1 deletion src/game/server/neo/bot/behavior/neo_bot_behavior.cpp
Original file line numberDiff line numberDiff line change
Expand Up@@ -872,7 +872,7 @@ void CNEOBotMainAction::FireWeaponAtEnemy( CNEOBot *me )
{
if (NEORules()->IsTeamplay())
{
me->PressSpecialFireButton(); // place a player ping to alert friends
me->PressPingButton(); // place a player ping to alert friends
}

if (bThreatIsGhoster)
Expand Down
2 changes: 2 additions & 0 deletions src/game/server/neo/bot/neo_bot.cpp
Original file line numberDiff line numberDiff line change
Expand Up@@ -443,6 +443,8 @@ DEFINE_SCRIPTFUNC_WRAPPED( GetSpawnArea, "Return the nav area of where we spawne
DEFINE_SCRIPTFUNC( PressFireButton, "" )
DEFINE_SCRIPTFUNC( PressAltFireButton, "" )
DEFINE_SCRIPTFUNC( PressSpecialFireButton, "" )
DEFINE_SCRIPTFUNC( PressPingButton, "" )
DEFINE_SCRIPTFUNC( ReleasePingButton, "" )

DEFINE_SCRIPTFUNC( GetBotId, "Get this bot's id" )
DEFINE_SCRIPTFUNC( FlagForUpdate, "Flag this bot for update" )
Expand Down
2 changes: 1 addition & 1 deletion src/game/server/player.cpp
Original file line numberDiff line numberDiff line change
Expand Up@@ -4049,7 +4049,7 @@ void CBasePlayer::PlayerRunCommand(CUserCmd *ucmd, IMoveHelper *moveHelper)
ucmd->sidemove = 0;
ucmd->upmove = 0;
ucmd->impulse = 0;
ucmd->buttons &= ~(IN_ATTACK | IN_ATTACK2 | IN_ATTACK3 | IN_JUMP | IN_ALT1 | IN_ALT2 | IN_ZOOM);
ucmd->buttons &= ~(IN_ATTACK | IN_ATTACK2 | IN_ATTACK3 | IN_PING | IN_JUMP | IN_ALT1 | IN_ALT2 | IN_ZOOM);
}
#endif

Expand Down
4 changes: 4 additions & 0 deletions src/game/server/vscript_server.cpp
Original file line numberDiff line numberDiff line change
Expand Up@@ -2933,7 +2933,11 @@ DECLARE_SCRIPT_CONST( FButtons, IN_WALK )
DECLARE_SCRIPT_CONST( FButtons, IN_ZOOM )
DECLARE_SCRIPT_CONST( FButtons, IN_WEAPON1 )
DECLARE_SCRIPT_CONST( FButtons, IN_WEAPON2 )
#ifdef NEO
DECLARE_SCRIPT_CONST( FButtons, IN_PING )
#else
DECLARE_SCRIPT_CONST( FButtons, IN_BULLRUSH )
#endif
DECLARE_SCRIPT_CONST( FButtons, IN_GRENADE1 )
DECLARE_SCRIPT_CONST( FButtons, IN_GRENADE2 )
DECLARE_SCRIPT_CONST( FButtons, IN_ATTACK3 )
Expand Down
4 changes: 4 additions & 0 deletions src/game/shared/in_buttons.h
Original file line numberDiff line numberDiff line change
Expand Up@@ -33,7 +33,11 @@
#define IN_ZOOM (1 << 19) // Zoom key for HUD zoom
#define IN_WEAPON1 (1 << 20) // weapon defines these bits
#define IN_WEAPON2 (1 << 21) // weapon defines these bits
#ifdef NEO
#define IN_PING (1 << 22) // player ping
#else
#define IN_BULLRUSH (1 << 22)
#endif
#define IN_GRENADE1 (1 << 23) // grenade 1
#define IN_GRENADE2 (1 << 24) // grenade 2
#define IN_ATTACK3 (1 << 25)
Expand Down
2 changes: 1 addition & 1 deletion src/game/shared/neo/neo_player_shared.cpp
Original file line numberDiff line numberDiff line change
Expand Up@@ -133,7 +133,7 @@ extern ConVar cl_neo_player_pings;
#endif // CLIENT_DLL
void CheckPingButton(CNEO_Player* player)
{
if (!player->IsAlive() || !(player->m_afButtonPressed & IN_ATTACK3) || player->m_flNextPingTime > gpGlobals->curtime)
if (!player->IsAlive() || !(player->m_afButtonPressed & IN_PING) || player->m_flNextPingTime > gpGlobals->curtime)
{
return;
}
Expand Down