Skip to content

Commit

Permalink
Fix ReturnAllNearby(): restore "pt" variable deleted by mistake
Browse files Browse the repository at this point in the history
  • Loading branch information
kyklish committed Dec 23, 2020
1 parent b66f9f2 commit 5461f00
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Code/Script.lua
Original file line number Diff line number Diff line change
Expand Up @@ -504,13 +504,14 @@ end
ReturnAllNearby = function(radius, sort, class)
-- local is faster then global
local table_sort = table.sort
local pt = GetTerrainCursor()

-- "radius" = meters * 100
radius = radius or 50

-- get objects inherited from "class" within radius
-- "guim" = 100 - global var ("meters-to-distance" coefficient)
local list = MapGet(GetTerrainCursor(), radius * guim, class)
local list = MapGet(pt, radius * guim, class)

-- sort list custom
if sort then
Expand Down

0 comments on commit 5461f00

Please sign in to comment.