aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorapickx <apickx@cogarr.com>2017-11-18 15:46:01 -0500
committerapickx <apickx@cogarr.com>2017-11-18 15:46:01 -0500
commit805bab2505625306133e7407706a21204fe88a21 (patch)
treeed2742baa7e30a777ae999e84509e2964822bb08
parentb4bb45d02810ab6ebd0160661499b36a01a05c37 (diff)
downloadzones-805bab2505625306133e7407706a21204fe88a21.tar.gz
zones-805bab2505625306133e7407706a21204fe88a21.tar.bz2
zones-805bab2505625306133e7407706a21204fe88a21.zip
Inital commit
-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