bone offset

This commit is contained in:
INeedBots
2020-10-29 13:59:49 -06:00
parent 4146b474a1
commit 0dd2f5990a
2 changed files with 22 additions and 3 deletions

View File

@ -2056,13 +2056,21 @@ aim()
target = self.bot.target.entity;
conedot = 0;
isplay = self.bot.target.isplay;
offset = self.bot.target.offset;
if (!isDefined(offset))
offset = (0, 0, 0);
dist = self.bot.target.dist;
rand = self.bot.target.rand;
no_trace_ads_time = self.pers["bots"]["skill"]["no_trace_ads_time"];
reaction_time = self.pers["bots"]["skill"]["reaction_time"];
nadeAimOffset = 0;
bone = self.bot.target.bone;
if (!isDefined(bone))
bone = "j_spineupper";
if(weaponClass(curweap) == "grenade" || curweap == "throwingknife_mp")
{
if (getWeaponClass(curweap) == "weapon_projectile")
@ -2109,7 +2117,10 @@ aim()
{
if(isplay)
{
aimpos = target getTagOrigin( "j_spineupper" ) + (0, 0, nadeAimOffset);
aimpos = target getTagOrigin( bone );
aimpos += offset;
aimpos += (0, 0, nadeAimOffset);
conedot = getConeDot(aimpos, eyePos, angles);
if (!nadeAimOffset && conedot > 0.999)
@ -2120,10 +2131,11 @@ aim()
else
{
aimpos = target.origin;
if (isDefined(offset))
aimpos += offset;
aimpos += offset;
aimpos += (0, 0, nadeAimOffset);
conedot = getConeDot(aimpos, eyePos, angles);
self thread bot_lookat(aimpos, aimspeed);
}