From 8575b5e45e8b2de3b03100c098e307fa7e51dea8 Mon Sep 17 00:00:00 2001 From: E-Almqvist Date: Thu, 20 Feb 2020 11:47:35 +0100 Subject: [PATCH] Added door detection to zones --- gamemode/engine/lib/server/sv_zone.lua | 12 ++++++++++++ gamemode/engine/vars/sv_vars.lua | 10 +++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/gamemode/engine/lib/server/sv_zone.lua b/gamemode/engine/lib/server/sv_zone.lua index 99a2a85..0bea5af 100644 --- a/gamemode/engine/lib/server/sv_zone.lua +++ b/gamemode/engine/lib/server/sv_zone.lua @@ -40,4 +40,16 @@ function Quantum.Server.Zone.GetCurrentZone( vec ) return zone end end +end + +function Quantum.Server.Zone.GetDoors( zoneid ) + local zone = Quantum.Server.Zone.Get( zoneid ) + local entInZone = {} + for i, ent in pairs( ents.FindInBox( zone.vec1, zone.vec2 ) ) do + if( Quantum.Server.DoorClasses[ ent:GetClass() ]) then + entInZone[i] = ent + end + end + + return entInZone end \ No newline at end of file diff --git a/gamemode/engine/vars/sv_vars.lua b/gamemode/engine/vars/sv_vars.lua index e5b9f95..e020f50 100644 --- a/gamemode/engine/vars/sv_vars.lua +++ b/gamemode/engine/vars/sv_vars.lua @@ -9,4 +9,12 @@ Quantum.Server.DefaultNodeHealth = 10 Quantum.Server.DefaultNodeRespawnTimer = 30 -Quantum.Server.DefualtPropertyPrice = 5000 \ No newline at end of file +Quantum.Server.DefualtPropertyPrice = 5000 + +Quantum.Server.DoorClasses = { + ["func_door"] = true, + ["func_door_rotating"] = true, + ["prop_door_rotating"] = true, + ["func_movelinear"] = true, + ["prop_dynamic"] = true +} \ No newline at end of file