diff --git a/main_shared/maps/mp/bots/_bot_script.gsc b/main_shared/maps/mp/bots/_bot_script.gsc index c97f6a2..bd0c25e 100644 --- a/main_shared/maps/mp/bots/_bot_script.gsc +++ b/main_shared/maps/mp/bots/_bot_script.gsc @@ -28,6 +28,7 @@ connected() self endon("disconnect"); self.killerLocation = undefined; + self.lastKiller = undefined; self thread difficulty(); self thread teamWatch(); @@ -43,6 +44,7 @@ connected() onKilled(eInflictor, eAttacker, iDamage, sMeansOfDeath, sWeapon, vDir, sHitLoc, timeOffset, deathAnimDuration) { self.killerLocation = undefined; + self.lastKiller = undefined; if(!IsDefined( self ) || !isDefined(self.team)) return; @@ -69,6 +71,7 @@ onKilled(eInflictor, eAttacker, iDamage, sMeansOfDeath, sWeapon, vDir, sHitLoc, return; self.killerLocation = eAttacker.origin; + self.lastKiller = eAttacker; } /* @@ -2371,6 +2374,14 @@ bot_revenge_think() if(self.pers["bots"]["skill"]["base"] <= 1) return; + + if (isDefined(self.lastKiller) && isAlive(self.lastKiller)) + { + if(bulletTracePassed(self getEyePos(), self.lastKiller getTagOrigin( "j_spineupper" ), false, self.lastKiller)) + { + self setAttacker(self.lastKiller); + } + } if(!isDefined(self.killerLocation)) return;