mirror of
https://github.com/Jackzmc/sourcemod-plugins.git
synced 2025-05-06 16:33:21 +00:00
jutils: Use squared value for GetNearestEntity
This commit is contained in:
parent
f75a8d8bed
commit
e19e449690
1 changed files with 1 additions and 1 deletions
|
@ -274,7 +274,7 @@ stock int GetNearestEntity(int client, char[] classname)
|
||||||
while ((entity = FindEntityByClassname(entity, classname)) != -1)
|
while ((entity = FindEntityByClassname(entity, classname)) != -1)
|
||||||
{
|
{
|
||||||
GetEntPropVector(entity, Prop_Data, "m_vecOrigin", entityVecOrigin);
|
GetEntPropVector(entity, Prop_Data, "m_vecOrigin", entityVecOrigin);
|
||||||
distance = GetVectorDistance(clientVecOrigin, entityVecOrigin);
|
distance = GetVectorDistance(clientVecOrigin, entityVecOrigin, true);
|
||||||
|
|
||||||
if (distance < nearestDistance || nearestDistance == -1.0)
|
if (distance < nearestDistance || nearestDistance == -1.0)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue