aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBob Blackmon <bob.blackmon@ymail.com>2017-04-03 10:53:25 -0400
committerBob Blackmon <bob.blackmon@ymail.com>2017-04-03 10:53:25 -0400
commit29224bc70179b9dcacd54ffd8d763fce776a4ca3 (patch)
treefd65f4ed2c774eea39a752719afc7955568411c1
parentd36ecf8d732e49132e4aca59a797efc8add45f53 (diff)
downloadzones-29224bc70179b9dcacd54ffd8d763fce776a4ca3.tar.gz
zones-29224bc70179b9dcacd54ffd8d763fce776a4ca3.tar.bz2
zones-29224bc70179b9dcacd54ffd8d763fce776a4ca3.zip
Moved hook to CalcBounds
-rw-r--r--lua/zones.lua7
1 files changed, 5 insertions, 2 deletions
diff --git a/lua/zones.lua b/lua/zones.lua
index 23b2aca..59412c9 100644
--- a/lua/zones.lua
+++ b/lua/zones.lua
@@ -196,7 +196,7 @@ if SERVER then
until (cur == ent)
- zones.CalcBounds(zone)
+ zones.CalcBounds(zone,true)
zones.List[id] = zone
hook.Run("OnZoneCreated",zone,zone.class,id)
@@ -208,7 +208,7 @@ if SERVER then
end
- function zones.CalcBounds(zone)
+ function zones.CalcBounds(zone,newZone)
zone.bounds = {}
for areanum,area in pairs(zone.points)do
local mins,maxs = Vector(10000000,10000000,area[1].z), Vector(-10000000,-10000000,area[1].z + zone.height[areanum])
@@ -220,6 +220,9 @@ if SERVER then
end
zone.bounds[areanum] = {mins=mins,maxs=maxs}
end
+ if not newZone then
+ hook.Run("OnZoneChanged",zones.List[id],zones.List[id].class,id)
+ end
end
function zones.Remove(id)