aboutsummaryrefslogtreecommitdiff
path: root/lua
diff options
context:
space:
mode:
authorBob Blackmon <bob.blackmon@ymail.com>2017-04-03 10:02:05 -0400
committerBob Blackmon <bob.blackmon@ymail.com>2017-04-03 10:02:05 -0400
commit24bf3c07b9374857525ada12c2f6beb3d6a06ce3 (patch)
treef7b5e61cd352a7e756481b5522edbc0abf505a0e /lua
parentcc29e774fee67fda00bf004dc2eeecb997713150 (diff)
downloadzones-24bf3c07b9374857525ada12c2f6beb3d6a06ce3.tar.gz
zones-24bf3c07b9374857525ada12c2f6beb3d6a06ce3.tar.bz2
zones-24bf3c07b9374857525ada12c2f6beb3d6a06ce3.zip
Class changes call OnZoneCreated
Diffstat (limited to 'lua')
-rw-r--r--lua/zones.lua13
1 files changed, 11 insertions, 2 deletions
diff --git a/lua/zones.lua b/lua/zones.lua
index ac0c9dd..bf380ca 100644
--- a/lua/zones.lua
+++ b/lua/zones.lua
@@ -1,5 +1,5 @@
-local version = 1.11 -- Older versions will not run if a newer version is used in another script.
+local version = 1.12 -- Older versions will not run if a newer version is used in another script.
--[[
ZONES - by Bobbleheadbob
WARNING: If you edit any of these files, make them use a different namespace. Multiple scripts may depend on this library so modifying it can break other scripts.
@@ -327,7 +327,16 @@ if SERVER then
v:SetZoneClass(class)
end
end
- zones.List[id].class = class
+
+ local zone,new = zones.List[id],{}
+ new.points = zone.points
+ new.height = zone.height
+ new.bounds = zone.bounds
+ new.class = class
+
+ zones.List[id] = new
+
+ hook.Run("OnZoneCreated",new,class,id)
zones.Sync()
end)