69 {
70 vector player_pos = player.GetPosition();
72 vector ref_dir = GetDirection();
73 ref_dir[1] = 0;
75
77 vector b1,b2;
81
82 vector dir_to_shelter = shelter_pos - player_pos;
83 dir_to_shelter[1] = 0;
84 float len = dir_to_shelter.
Length();
85
87
90 vector test_angles = dir_to_shelter_angle - ref_dir_angle;
91
93
94 if (test_position[0] < b1[0] || test_position[0] > b2[0] || test_position[2] < 0.2 || test_position[2] > 2.2 )
95 {
96 return false;
97 }
98 else
99 {
100 return true;
101 }
102 }
proto native float Length()
Returns length of vector (magnitude)
proto float Normalize()
Normalizes vector. Returns length.
proto vector VectorToAngles()
Converts vector to spherical coordinates with radius = 1.
proto vector AnglesToVector()
Converts spherical coordinates (yaw, pitch, roll in degrees) to unit length vector.
vector GetPosition()
Get the world position of the Effect.