PDA

View Full Version : Mob::IsEngaged()


c0ncrete
07-10-2010, 11:47 AM
In line 891 in mob.h

replace this:
bool IsEngaged() { return( !hate_list.IsEmpty() ); }

with something like this:
bool IsEngaged() { return( IsAIControlled() ? !hate_list.IsEmpty() : !CastToClient()->GetAggroCount() ); }

This should clear up some logic issues in the current bot code.

Reasoning: Combat checks are made to determine if a player is allowed to spawn a bot. Since a client's hate list is always empty, they're able to spawn a bot when they have aggro (assuming they don't have any bots spawned). This allows a client to camp bots and respawn them to zerg raid targets until they're dead.

I don't think it should have any adverse effects on other processes.

c0ncrete
07-10-2010, 01:19 PM
In addition to the previous reasoning behind the suggested change, priest bots (CLR, DRU, SHM) use tar->IsEngaged() to determine how they heal a target. With the current logic and the way IsEngaged() works, a client will only receive a CHeal from a bot if they fall below 30% health. They get a normal single-target heal from 30-74% health and a HoT anywhere above that.

c0ncrete
07-19-2010, 09:51 PM
I'm an idiot.

That doesn't work at all.