@@ -36,10 +36,10 @@ ConVar neo_bot_fire_weapon_allowed( "neo_bot_fire_weapon_allowed", "1", FCVAR_CH
3636
3737ConVar neo_bot_allow_retreat ( " neo_bot_allow_retreat" , " 1" , FCVAR_CHEAT , " If zero, bots will not attempt to retreat if they are are in a bad situation." );
3838
39- ConVar neo_bot_recon_superjump_min_dist ( " neo_bot_recon_superjump_min_dist" , " 1000 " , FCVAR_NONE ,
39+ ConVar neo_bot_recon_superjump_min_dist ( " neo_bot_recon_superjump_min_dist" , " 4096 " , FCVAR_NONE ,
4040 " Minimum straight-line path distance required for a Recon bot to super jump while moving" , true , 0 , false , 0 );
4141
42- ConVar neo_bot_recon_superjump_min_accuracy ( " neo_bot_recon_superjump_min_accuracy" , " 0.95 " , FCVAR_NONE ,
42+ ConVar neo_bot_recon_superjump_min_accuracy ( " neo_bot_recon_superjump_min_accuracy" , " 0.96 " , FCVAR_NONE ,
4343 " Minimum directional alignment with path required for a Recon bot to super jump while moving" , true , 0 .1f , false , 1 .0f );
4444
4545// ---------------------------------------------------------------------------------------------
@@ -370,30 +370,30 @@ Vector CNEOBotMainAction::SelectTargetPoint( const INextBot *meBot, const CBaseC
370370// -----------------------------------------------------------------------------------------
371371void CNEOBotMainAction::ReconConsiderSuperJump ( CNEOBot *me )
372372{
373- CNEO_Player *pNeoMe = ToNEOPlayer (me);
374- if ( !pNeoMe || pNeoMe->GetClass () != NEO_CLASS_RECON )
373+ if ( me->GetClass () != NEO_CLASS_RECON )
375374 {
376375 return ;
377376 }
378377
379378 // Check that bot isn't only moving sideways which wastes aux power
380379 // Also determines a direction to jump towards
381380 // NEO Jank: We don't check sprint here because bots don't anticipate using sprint in a smart manner
382- if ( ( pNeoMe->m_nButtons & ( IN_FORWARD | IN_BACK ) ) == 0 )
381+ const int nForwardBack = me->m_nButtons & ( IN_FORWARD | IN_BACK );
382+ if ( nForwardBack == 0 || nForwardBack == ( IN_FORWARD | IN_BACK ) )
383383 {
384384 // Remove this check if we add sideways super jump in the future
385385 return ;
386386 }
387387
388- if (!pNeoMe ->IsAllowedToSuperJump ())
388+ if (!me ->IsAllowedToSuperJump ())
389389 {
390390 return ;
391391 }
392392
393- bool bImmediateDanger = gpGlobals->curtime - pNeoMe ->GetLastDamageTime () <= 2 .0f ;
393+ bool bImmediateDanger = gpGlobals->curtime - me ->GetLastDamageTime () <= 2 .0f ;
394394
395395 if (!bImmediateDanger
396- && (pNeoMe ->m_nButtons & IN_FORWARD )
396+ && (me ->m_nButtons & IN_FORWARD )
397397 && (neo_bot_recon_superjump_min_dist.GetFloat () > 1 ))
398398 {
399399 if (!m_reconSuperJumpPathCheckTimer.IsElapsed ())
@@ -421,7 +421,7 @@ void CNEOBotMainAction::ReconConsiderSuperJump( CNEOBot *me )
421421
422422 // Get the bot's facing direction
423423 Vector vecFacing;
424- pNeoMe ->EyeVectors ( &vecFacing );
424+ me ->EyeVectors ( &vecFacing );
425425 vecFacing.z = 0 .0f ;
426426 vecFacing.NormalizeInPlace ();
427427
@@ -455,7 +455,7 @@ void CNEOBotMainAction::ReconConsiderSuperJump( CNEOBot *me )
455455 }
456456
457457 // Sanity check that each waypoint is relatively aligned with our jump direction
458- Vector vecToWaypoint = seg->pos - pNeoMe ->GetAbsOrigin ();
458+ Vector vecToWaypoint = seg->pos - me ->GetAbsOrigin ();
459459 vecToWaypoint.z = 0 .0f ;
460460
461461 float flDist = vecToWaypoint.NormalizeInPlace ();
@@ -470,7 +470,7 @@ void CNEOBotMainAction::ReconConsiderSuperJump( CNEOBot *me )
470470 bCanJump = true ;
471471 break ;
472472 }
473- else if (flDist < 0 )
473+ else if ( ! IsFinite ( flDist ) || flDist < 0 )
474474 {
475475 return ; // Just in case of a bad value
476476 }
0 commit comments