Fix doubletabs with alt weap

This commit is contained in:
ineedbots 2021-11-22 21:39:40 -06:00
parent 2e05a2f6d7
commit 45d302cd2b

View File

@ -4171,6 +4171,7 @@ bot_crate_think()
*/ */
doReloadCancel_loop() doReloadCancel_loop()
{ {
curWeap = self GetCurrentWeapon();
ret = self waittill_either_return( "reload", "weapon_change" ); ret = self waittill_either_return( "reload", "weapon_change" );
if ( self BotIsFrozen() ) if ( self BotIsFrozen() )
@ -4185,11 +4186,18 @@ doReloadCancel_loop()
if ( self InLastStand() && !self InFinalStand() ) if ( self InLastStand() && !self InFinalStand() )
return; return;
curWeap = self GetCurrentWeapon(); if ( !getDvarInt( "sv_enableDoubleTaps" ) )
if ( getDvar( "sv_enableDoubleTaps" ) == "0" )
return; return;
// wait for an actual change
if ( ret == "weapon_change" )
{
for ( i = 0; i < 10 && curWeap == self GetCurrentWeapon(); i++ )
wait 0.05;
}
curWeap = self GetCurrentWeapon();
if ( !maps\mp\gametypes\_weapons::isPrimaryWeapon( curWeap ) ) if ( !maps\mp\gametypes\_weapons::isPrimaryWeapon( curWeap ) )
return; return;