diff options
Diffstat (limited to 'gamemode/shared/entity_ext.lua')
| -rw-r--r-- | gamemode/shared/entity_ext.lua | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/gamemode/shared/entity_ext.lua b/gamemode/shared/entity_ext.lua new file mode 100644 index 0000000..c0e1b34 --- /dev/null +++ b/gamemode/shared/entity_ext.lua @@ -0,0 +1,19 @@ +local meta = FindMetaTable("Entity")
+
+function meta:IsTree()
+ local model = self:GetModel()
+ local class = self:GetClass()
+ return ((model:find("tree") or model:find("pine")) and !class:find("ws_"))
+end
+
+function meta:IsRock()
+ local model = self:GetModel()
+ local class = self:GetClass()
+ return (model:find("rock") and !class:find("ws_"))
+end
+
+function meta:IsPlant()
+ local model = self:GetModel()
+ local class = self:GetClass()
+ return (model:find("antlionhill") and !class:find("ws_"))
+end
\ No newline at end of file |
