This commit is contained in:
INeedBots 2021-03-10 15:16:14 -06:00
parent 440a3c561b
commit 0604980d8e

View File

@ -428,7 +428,6 @@ doBotMovement()
move_To = self.bot.moveTo; move_To = self.bot.moveTo;
angles = self GetPlayerAngles(); angles = self GetPlayerAngles();
dir = (0, 0, 0); dir = (0, 0, 0);
eye = self getEye();
if (DistanceSquared(self.origin, move_To) >= 49) if (DistanceSquared(self.origin, move_To) >= 49)
{ {
@ -454,15 +453,11 @@ doBotMovement()
if (self isMantling()) if (self isMantling())
self crouch(); self crouch();
// check if need to knife glass
bt = bulletTrace(eye, eye + anglesToForward(angles) * FORWARDAMOUNT, false, self);
if (bt["surfacetype"] == "glass")
self thread knife();
startPos = self.origin + (0, 0, 50); startPos = self.origin + (0, 0, 50);
startPosForward = startPos + anglesToForward((0, angles[1], 0)) * FORWARDAMOUNT; startPosForward = startPos + anglesToForward((0, angles[1], 0)) * FORWARDAMOUNT;
if (bulletTracePassed(startPos, startPosForward, false, self)) bt = bulletTrace(startPos, startPosForward, false, self);
if (bt["fraction"] >= 1)
{ {
// check if need to jump // check if need to jump
bt = bulletTrace(startPosForward, startPosForward - (0, 0, 40), false, self); bt = bulletTrace(startPosForward, startPosForward - (0, 0, 40), false, self);
@ -473,6 +468,15 @@ doBotMovement()
self thread jump(); self thread jump();
} }
} }
// check if need to knife glass
else if (bt["surfacetype"] == "glass")
{
if (i > 1.5)
{
i = 0;
self thread knife();
}
}
else else
{ {
// check if need to crouch // check if need to crouch