thread resurrection again
Due to the bug I just found out in my latest CP beta, Ive tracked down very strange part of the DetermineCombatRound code that very probably doesn't work as intented.
line 977:
if (GetIsDead(oIntruder) == TRUE)
{
// ----------------------------------------------------------------------------------------
// If for some reason my target is dead, then leave
// the poor guy alone. Jeez. What kind of monster am I?
// ----------------------------------------------------------------------------------------
return;
}
Now, I have added the check for oIntuder validity in my AI code in CP and what happened is that creatures stopped chasing running PCs.
It turned out that this GetIsDead returns TRUE on invalid target - which is why the default AI chasing PCs normally.
Looking into this, is clear that unless there is another target this line will not cancel the attack on the dying PC.
Also, due to this line the code below line 1037 will never happen - strange is, that its just this remaining code that will cancel the creature's attack if the line above is "fixed" - which would indicate that the "chasing" wasn't meant at all, however if the GetAttackTarget would have worked properly, creature would still chased her targets.
Unfortunately, GetAttackTarget doesn't work on NPCs, at least if they aren't in combat, so the target of the creature chasing PC is always invalid, unless there is new target in her vision range which cause her to change the target.
Well this code should restore the chasing behavior with enabling the attack cancel on dying PC.
if(!GetIsObjectValid(oIntruder) && GetCurrentAction() == ACTION_ATTACKOBJECT)
{
return;
}
else if(GetIsDead(oIntruder) )
{
// ----------------------------------------------------------------------------------------
// If for some reason my target is dead, then leave
// the poor guy alone. Jeez. What kind of monster am I?
// ----------------------------------------------------------------------------------------
ClearAllActions();
return;
}
but due to this return code, sometimes happens that creature chasing PC ignores GS effect - since the DetermineCombatRound doesn't fires before this NPC find the target and attack I don't see a way how to fix this GS issue.
Modifié par ShaDoOoW, 18 décembre 2012 - 07:14 .