diff options
| author | Bob Blackmon <bob.blackmon@ymail.com> | 2017-04-03 10:05:12 -0400 |
|---|---|---|
| committer | Bob Blackmon <bob.blackmon@ymail.com> | 2017-04-03 10:05:12 -0400 |
| commit | 46f6d895599c5c23b5fa80c5a1d4eff753262db0 (patch) | |
| tree | 5e32d9e57d82fe2844460aac5c2fe48f246791c5 | |
| parent | 24bf3c07b9374857525ada12c2f6beb3d6a06ce3 (diff) | |
| download | zones-46f6d895599c5c23b5fa80c5a1d4eff753262db0.tar.gz zones-46f6d895599c5c23b5fa80c5a1d4eff753262db0.tar.bz2 zones-46f6d895599c5c23b5fa80c5a1d4eff753262db0.zip | |
Added zones.ChangeClass
| -rw-r--r-- | lua/zones.lua | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/lua/zones.lua b/lua/zones.lua index bf380ca..7f67e43 100644 --- a/lua/zones.lua +++ b/lua/zones.lua @@ -310,6 +310,20 @@ if SERVER then end + function zones.ChangeClass(id,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 + hook.Add("Initialize","claim_load",function() zones.LoadZones() end) @@ -328,17 +342,8 @@ if SERVER then end end - local zone,new = zones.List[id],{} - new.points = zone.points - new.height = zone.height - new.bounds = zone.bounds - new.class = class + zones.ChangeClass(id,class) - zones.List[id] = new - - hook.Run("OnZoneCreated",new,class,id) - - zones.Sync() end) else |
