Skip to content

Commit bc0068b

Browse files
committed
street
1 parent 1cdc0dd commit bc0068b

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

scripts/vscripts/tf2ware_ultimate/botbehavior/minigames/street_fighter.nut

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,23 @@ function OnUpdate(bot)
1212
{
1313
local dest = prop.GetCenter() + Vector(RandomFloat(-33,33), RandomFloat(-33,33), 0)
1414
data.dest <- dest
15+
data.prop <- prop
1516
//DebugDrawLine(bot.GetOrigin(), data.dest, 255, 0, 0, true, 1)
1617
}
17-
BotLookAt(bot, prop.GetCenter(), 9999.0, 9999.0)
18+
BotLookAt(bot, data.prop.GetCenter(), 9999.0, 9999.0)
1819
local loco = bot.GetLocomotionInterface()
19-
loco.FaceTowards(prop.GetCenter())
20+
loco.FaceTowards(data.prop.GetCenter())
2021
loco.Approach(data.dest, 999.0)
2122
if (RandomInt(0,4) == 0)
2223
bot.PressFireButton(-1)
2324
//if (RandomInt(0,50) == 0)
2425
// loco.Jump()
2526
local dist = VectorDistance(data.dest, bot.GetCenter())
26-
local dist2 = VectorDistance(prop.GetCenter(), data.dest)
27+
local dist2 = VectorDistance(data.prop.GetCenter(), data.dest)
2728
//Ware_ChatPrint(null, "{int}", dist2)
2829
if (dist < 50 || dist2 > 200)
2930
data.dest = null
30-
if (VectorDistance(bot.GetCenter(), prop.GetCenter()) < 900)
31+
if (VectorDistance(bot.GetCenter(), data.prop.GetCenter()) < 900)
3132
bot.Taunt(TAUNT_BASE_WEAPON, 0)
3233
break
3334
}

0 commit comments

Comments
 (0)