mirror of
https://github.com/ineedbots/iw2_bot_warfare.git
synced 2025-04-22 07:25:42 +00:00
pickup weapons
This commit is contained in:
parent
4236e83079
commit
af95d81775
@ -300,10 +300,32 @@ spawned()
|
||||
self thread aim();
|
||||
self thread watchHoldBreath();
|
||||
self thread onNewEnemy();
|
||||
self thread watchPickupGun();
|
||||
|
||||
self notify( "bot_spawned" );
|
||||
}
|
||||
|
||||
/*
|
||||
watchPickupGun
|
||||
*/
|
||||
watchPickupGun()
|
||||
{
|
||||
self endon( "disconnect" );
|
||||
self endon( "death" );
|
||||
|
||||
for ( ;; )
|
||||
{
|
||||
wait 1;
|
||||
|
||||
weap = self GetCurrentWeapon();
|
||||
|
||||
if ( weap != "none" && self GetAmmoCount( weap ) )
|
||||
continue;
|
||||
|
||||
self thread use( 0.5 );
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Sets the factor of distance for a weapon
|
||||
*/
|
||||
@ -1050,7 +1072,7 @@ aim_loop()
|
||||
if ( !isDefined( bone ) )
|
||||
bone = "j_spineupper";
|
||||
|
||||
if ( self.bot.isfraggingafter || self.bot.issmokingafter )
|
||||
if ( self.bot.isfraggingafter || self.bot.issmokingafter || isSubStr( "_grenade_", curweap ) )
|
||||
nadeAimOffset = dist / 3000;
|
||||
|
||||
if ( no_trace_time && ( !isDefined( self.bot.after_target ) || self.bot.after_target != target ) )
|
||||
@ -1171,7 +1193,7 @@ aim_loop()
|
||||
last_pos = self.bot.after_target_pos;
|
||||
dist = DistanceSquared( self.origin, last_pos );
|
||||
|
||||
if ( self.bot.isfraggingafter || self.bot.issmokingafter )
|
||||
if ( self.bot.isfraggingafter || self.bot.issmokingafter || isSubStr( "_grenade_", curweap ) )
|
||||
nadeAimOffset = dist / 3000;
|
||||
|
||||
aimpos = last_pos + ( 0, 0, self getEyeHeight() + nadeAimOffset );
|
||||
|
@ -437,6 +437,16 @@ getWeaponSlot( weap )
|
||||
return "primaryb";
|
||||
}
|
||||
|
||||
/*
|
||||
cOD2
|
||||
*/
|
||||
GetAmmoCount( weap )
|
||||
{
|
||||
slot = self getWeaponSlot( weap );
|
||||
|
||||
return self GetWeaponSlotClipAmmo( slot ) + self GetWeaponSlotAmmo( slot );
|
||||
}
|
||||
|
||||
/*
|
||||
IsWeaponClipOnly cod2
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user