From 29224bc70179b9dcacd54ffd8d763fce776a4ca3 Mon Sep 17 00:00:00 2001 From: Bob Blackmon Date: Mon, 3 Apr 2017 10:53:25 -0400 Subject: Moved hook to CalcBounds --- lua/zones.lua | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'lua') 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) -- cgit v1.2.3-70-g09d2