1
0
mirror of https://github.com/metrostroi-repo/MetrostroiAddon.git synced 2026-05-02 00:42:29 +00:00

Distance -> DistToSqr

This commit is contained in:
Hellss
2022-06-04 12:53:34 +03:00
parent 7383dcdd45
commit dfad20eec1
9 changed files with 10 additions and 10 deletions

View File

@@ -268,7 +268,7 @@ function ENT:Think()
local BoardTime = 8+7*self.HorliftStation
for k,v in pairs(ents.FindByClass("gmod_subway_*")) do
if v.Base ~= "gmod_subway_base" and v:GetClass() ~= "gmod_subway_base" then continue end
if not IsValid(v) or v:GetPos():Distance(self:GetPos()) > self.PlatformStart:Distance(self.PlatformEnd) then continue end
if not IsValid(v) or v:GetPos():DistToSqr(self:GetPos()) > self.PlatformStart:DistToSqr(self.PlatformEnd) then continue end
local platform_distance = ((self.PlatformStart-v:GetPos()) - ((self.PlatformStart-v:GetPos()):Dot(self.PlatformNorm))*self.PlatformNorm):Length()
local vertical_distance = math.abs(v:GetPos().z - self.PlatformStart.z)