View Single Post
  #1  
Old 04-15-2010, 01:23 AM
Frosef
Sarnak
 
Join Date: Mar 2010
Posts: 36
Default "Fix" for Bot LOS Issues

I say "fix" because whether or not this is a problem is a matter of opinion, really.

I didn't particularly like how bots stand around and do nothing if their target is out of their LOS, but I also understand it could cause some crazy trains if they decided to path strangely whilst moving to something.

So, my quick and dirty solution was to add another check before emptying the bot hate list to check both the bots' LOS and their owners' LOS before emptying the hate list. This way if say, a mob runs around crazylike and through the walls and it's out of both mine and my bot's LOS, the bot will wipe the hate list to prevent incident.

bot.cpp, line 2195 (inside the AIProcess function), my addition in bold:
Code:
if((!CheckLosFN(GetTarget()) && !BotOwner->CheckLosFN(GetTarget())) || GetTarget()->IsMezzed() || !IsAttackAllowed(GetTarget())) {
I don't know CPP, so I can't say for sure it's proper syntax, but it seems to be working as I expected thus far. I like the way this plays out a lot better, now my bots will round corners to assist me in dungeons and such.
Reply With Quote