Claymore fix

This commit is contained in:
Your Name 2020-08-07 13:22:12 -06:00
parent 797e7095b2
commit bc37334d90
3 changed files with 52 additions and 2 deletions

View File

@ -554,6 +554,11 @@ onGrenadeFire()
grenade.name = weaponName; grenade.name = weaponName;
if(weaponName == "smoke_grenade_mp") if(weaponName == "smoke_grenade_mp")
grenade thread AddToSmokeList(); grenade thread AddToSmokeList();
if ( weaponName == "claymore" || weaponName == "claymore_mp" )
{
grenade thread claymoreDetonationBotFix();
}
} }
} }

View File

@ -150,12 +150,11 @@ onPlayerSpawned()
self thread fireHack(); self thread fireHack();
self thread stanceHack(); self thread stanceHack();
self thread moveHack(); self thread moveHack();
self thread emptyClipShoot();
self thread UseRunThink(); self thread UseRunThink();
self thread watchUsingRemote(); self thread watchUsingRemote();
// grenades (pick up too), knife (players and ents), stinger, footsounds, claymore hack // grenades (pick up too), knife (players and ents), stinger, footsounds
self thread spawned(); self thread spawned();
} }
@ -801,6 +800,8 @@ spawned()
wait self.pers["bots"]["skill"]["spawn_time"]; wait self.pers["bots"]["skill"]["spawn_time"];
self thread emptyClipShoot();
self thread target(); self thread target();
self thread aim(); self thread aim();
self thread check_reload(); self thread check_reload();

View File

@ -1714,3 +1714,47 @@ botPlayerModelForWeapon( weapon, secondary )
break; break;
} }
} }
claymoreDetonationBotFix()
{
self endon( "death" );
self waittill( "missile_stuck" );
damagearea = spawn( "trigger_radius", self.origin + ( 0, 0, 0 - level.claymoreDetonateRadius ), 0, level.claymoreDetonateRadius, level.claymoreDetonateRadius * 2 );
self thread maps\mp\gametypes\_weapons::deleteOnDeath( damagearea );
while ( 1 )
{
damagearea waittill( "trigger", player );
if (!player is_bot())
continue;
if ( getdvarint( "scr_claymoredebug" ) != 1 )
{
if ( isdefined( self.owner ) && player == self.owner )
continue;
if ( !maps\mp\gametypes\_weapons::friendlyFireCheck( self.owner, player, 0 ) )
continue;
}
if ( lengthsquared( player getBotVelocity() ) < 10 )
continue;
if ( !player maps\mp\gametypes\_weapons::shouldAffectClaymore( self ) )
continue;
if ( player damageConeTrace( self.origin, self ) > 0 )
break;
}
self playsound ("claymore_activated");
if ( player _hasPerk( "specialty_delaymine" ) )
wait 3.0;
else
wait level.claymoreDetectionGracePeriod;
self detonate();
}