mirror of
https://github.com/ineedbots/iw3_bot_warfare.git
synced 2025-04-20 17:55:42 +00:00
bone offset
This commit is contained in:
parent
6a2cc9d561
commit
3aa3ea10bb
@ -875,13 +875,21 @@ aim()
|
|||||||
target = self.bot.target.entity;
|
target = self.bot.target.entity;
|
||||||
conedot = 0;
|
conedot = 0;
|
||||||
isplay = self.bot.target.isplay;
|
isplay = self.bot.target.isplay;
|
||||||
|
|
||||||
offset = self.bot.target.offset;
|
offset = self.bot.target.offset;
|
||||||
|
if (!isDefined(offset))
|
||||||
|
offset = (0, 0, 0);
|
||||||
|
|
||||||
dist = self.bot.target.dist;
|
dist = self.bot.target.dist;
|
||||||
rand = self.bot.target.rand;
|
rand = self.bot.target.rand;
|
||||||
no_trace_ads_time = self.pers["bots"]["skill"]["no_trace_ads_time"];
|
no_trace_ads_time = self.pers["bots"]["skill"]["no_trace_ads_time"];
|
||||||
reaction_time = self.pers["bots"]["skill"]["reaction_time"];
|
reaction_time = self.pers["bots"]["skill"]["reaction_time"];
|
||||||
nadeAimOffset = 0;
|
nadeAimOffset = 0;
|
||||||
|
|
||||||
|
bone = self.bot.target.bone;
|
||||||
|
if (!isDefined(bone))
|
||||||
|
bone = "j_spineupper";
|
||||||
|
|
||||||
if(self.bot.isfraggingafter || self.bot.issmokingafter)
|
if(self.bot.isfraggingafter || self.bot.issmokingafter)
|
||||||
nadeAimOffset = dist/3000;
|
nadeAimOffset = dist/3000;
|
||||||
else if(weaponClass(curweap) == "grenade")
|
else if(weaponClass(curweap) == "grenade")
|
||||||
@ -923,25 +931,25 @@ aim()
|
|||||||
{
|
{
|
||||||
if(isplay)
|
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);
|
conedot = getConeDot(aimpos, eyePos, angles);
|
||||||
|
|
||||||
if(!nadeAimOffset && conedot > 0.999)
|
if(!nadeAimOffset && conedot > 0.999)
|
||||||
{
|
self botLookAtPlayer(target, bone);
|
||||||
self botLookAtPlayer(target, "j_spineupper");
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
|
||||||
self botLookAt(aimpos, aimspeed);
|
self botLookAt(aimpos, aimspeed);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
aimpos = target.origin;
|
aimpos = target.origin;
|
||||||
if (isDefined(offset))
|
|
||||||
aimpos += offset;
|
aimpos += offset;
|
||||||
aimpos += (0, 0, nadeAimOffset);
|
aimpos += (0, 0, nadeAimOffset);
|
||||||
|
|
||||||
conedot = getConeDot(aimpos, eyePos, angles);
|
conedot = getConeDot(aimpos, eyePos, angles);
|
||||||
|
|
||||||
self botLookAt(aimpos, aimspeed);
|
self botLookAt(aimpos, aimspeed);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user