X-Git-Url: https://git.jsancho.org/?p=lugaru.git;a=blobdiff_plain;f=Source%2FObjects%2FPerson.cpp;fp=Source%2FObjects%2FPerson.cpp;h=8898cac60bba81fce30ded86d76c38b5dc9c3ea4;hp=0ca911a0114ae16dc010426f0ca72150036966bd;hb=265236f7b4d05d576a4a6fd81823abff5f3f757b;hpb=a4fa4c9e3d7087b3789ff16238089547e78b818f diff --git a/Source/Objects/Person.cpp b/Source/Objects/Person.cpp index 0ca911a..8898cac 100644 --- a/Source/Objects/Person.cpp +++ b/Source/Objects/Person.cpp @@ -8417,3 +8417,10 @@ void Person::doAI() } } } + +bool Person::catchKnife() +{ + return + ((PersonType::types[creature].knifeCatchingType == 0) && (Random() % 2 != 0) && (weaponactive == -1) && (aitype == attacktypecutoff)) || + ((PersonType::types[creature].knifeCatchingType == 1) && (Random() % 3 != 0) && (weaponactive == -1) && (isIdle() || isRun() || animTarget == walkanim)); +}