93 {
95 if (!Class.CastTo(entity, actor_in_radius))
96 return true;
97
99 if (entity == player)
100 return true;
101 if (entity.IsParticle())
102 return true;
103 if (entity.IsScriptedLight())
104 return true;
105 if (entity.IsBeingPlaced())
106 return true;
107 if (entity.IsHologram())
108 return true;
109 if (entity.
IsMan() || entity.IsZombie() || entity.IsZombieMilitary())
110 {
111
112 vector entityPosition = entity.GetPosition();
113
114 if (entity && entity.
IsMan())
115 {
116 PlayerBase vicinityPlayer = PlayerBase.Cast(entity);
117 if (vicinityPlayer)
118 {
119 entityPosition = vicinityPlayer.GetBonePositionWS(vicinityPlayer.GetBoneIndexByName("spine3"));
120 }
121 }
122 else if (entity && (entity.IsZombie() || entity.IsZombieMilitary()))
123 {
124 ZombieBase zombie = ZombieBase.Cast(entity);
125 if (zombie)
126 {
127 entityPosition = zombie.GetBonePositionWS(zombie.GetBoneIndexByName("spine3"));
128 }
129 }
130
132 if (FreeDebugCamera.GetInstance() && FreeDebugCamera.GetInstance().IsActive())
133 {
134 return false;
135 }
136
137 vector entityDirection = player.GetPosition() - entityPosition;
139 entityDirection[1] = 0;
140
141 vector playerDirection = MiscGameplayFunctions.GetHeadingVector(player);
143 playerDirection[1] = 0;
144
145 float dotRadians = vector.
Dot(playerDirection, entityDirection);
146 if (dotRadians > -0.5)
147 return true;
148 }
149
150 return false;
151 }
static float Dot(vector v1, vector v2)
Returns Dot product of vector v1 and vector v2.
proto float Normalize()
Normalizes vector. Returns length.
proto native CGame GetGame()