827 {
828 pAnimType = -1;
829 if ( pComponent == "LeftLeg" && GetHealth(pComponent, "Health") == 0 )
830 pAnimType = 0;
831 else if ( pComponent == "RightLeg" && GetHealth(pComponent, "Health") == 0 )
832 pAnimType = 2;
833
834 if ( pAnimType != -1 )
835 {
836 vector targetDirection = GetDirection();
837 vector toSourceDirection = (pSource.GetPosition() -
GetPosition());
838
839 targetDirection[1] = 0;
840 toSourceDirection[1] = 0;
841
844
845 float cosFi = vector.Dot(targetDirection, toSourceDirection);
846 if ( cosFi >= 0 )
847 pAnimType++;
848 }
849
850 return pAnimType != -1;
851 }
proto float Normalize()
Normalizes vector. Returns length.
vector GetPosition()
Get the world position of the Effect.