X-Git-Url: https://git.jsancho.org/?p=lugaru.git;a=blobdiff_plain;f=Source%2FObjects%2FPerson.cpp;fp=Source%2FObjects%2FPerson.cpp;h=b1403075b6f3b8efcf280375ee2cda1890cdd2a2;hp=5a735c3a0cf5d50ff66f9ab4bb843171449b3a73;hb=43b29d6c2092964efbba5ee4d5f4a559d86bc508;hpb=a99778b1da1ea16a6a87a00461cd2c4e36ab13a3 diff --git a/Source/Objects/Person.cpp b/Source/Objects/Person.cpp index 5a735c3..b140307 100644 --- a/Source/Objects/Person.cpp +++ b/Source/Objects/Person.cpp @@ -7339,6 +7339,10 @@ void Person::doAI() pause = 1; } + if (isPlayerFriend() && aitype == pathfindtype) { + aitype = passivetype; + } + //pathfinding if (aitype == pathfindtype) { if (finalpathfindpoint == -1) { @@ -8382,8 +8386,16 @@ void Person::doAI() } if (stunned < 1 && isPlayerFriend()) { + // friends help player with its enemies + if (Game::musictype == stream_fighttheme && hasvictim) { + aitype = attacktypecutoff; + } else { + aitype = pathfindtype; + } + // friends follow player if (!Person::players[0]->dead && + aitype == pathfindtype && distsq(&coords, &Person::players[0]->coords) > 5) { XYZ rotatetarget = Person::players[0]->coords + Person::players[0]->velocity; XYZ targetpoint = Person::players[0]->coords; @@ -8398,12 +8410,6 @@ void Person::doAI() targetyaw = roughDirectionTo(coords, targetpoint); lookyaw = targetyaw; forwardkeydown = 1; - aitype = pathfindtype; - } - - // friends help player with its enemies - if (Game::musictype == stream_fighttheme) { - aitype = attacktypecutoff; } }