815 {
816 pAnimType = -1;
817 if ( pComponent == "LeftLeg" && GetHealth(pComponent, "Health") == 0 )
818 pAnimType = 0;
819 else if ( pComponent == "RightLeg" && GetHealth(pComponent, "Health") == 0 )
820 pAnimType = 2;
821
822 if ( pAnimType != -1 )
823 {
824 vector targetDirection = GetDirection();
825 vector toSourceDirection = (pSource.GetPosition() -
GetPosition());
826
827 targetDirection[1] = 0;
828 toSourceDirection[1] = 0;
829
832
833 float cosFi = vector.Dot(targetDirection, toSourceDirection);
834 if ( cosFi >= 0 )
835 pAnimType++;
836 }
837
838 return pAnimType != -1;
839 }
proto float Normalize()
Normalizes vector. Returns length.
class JsonUndergroundAreaTriggerData GetPosition