aboutsummaryrefslogtreecommitdiff
path: root/lua
diff options
context:
space:
mode:
Diffstat (limited to 'lua')
-rw-r--r--lua/autorun/zones.lua (renamed from lua/zones.lua)4
1 files changed, 3 insertions, 1 deletions
diff --git a/lua/zones.lua b/lua/autorun/zones.lua
index f95d6f2..a8b41cf 100644
--- a/lua/zones.lua
+++ b/lua/autorun/zones.lua
@@ -77,6 +77,8 @@ end
local plymeta = FindMetaTable("Player")
--returns one of the zones a player is found in. Also returns that zone's ID. Class is optional to filter the search.
function plymeta:GetCurrentZone(class)
+ zones.Cache = zones.Cache or {}
+ zones.Cache[self] = zones.Cache[self] or {}
local c = zones.Cache[self][class or "___"]
if c then return unpack(c) end
local z,id = zones.GetZoneAt(self:GetPos(), class)
@@ -608,4 +610,4 @@ function zones.PointInPoly(point,poly) //True if point is within a polygon.
end
return inside
-end \ No newline at end of file
+end