aboutsummaryrefslogtreecommitdiff
path: root/gamemode/shared/entity_ext.lua
diff options
context:
space:
mode:
authorApickx <Apickx@cogarr.org>2015-12-28 19:10:44 -0500
committerApickx <Apickx@cogarr.org>2015-12-28 19:10:44 -0500
commit5c4ebc932d8c02522802c842d43d863d89aca162 (patch)
tree6be7ad664bdf060127e6df6baa72beaf508aa149 /gamemode/shared/entity_ext.lua
downloadwintersurvival2-5c4ebc932d8c02522802c842d43d863d89aca162.tar.gz
wintersurvival2-5c4ebc932d8c02522802c842d43d863d89aca162.tar.bz2
wintersurvival2-5c4ebc932d8c02522802c842d43d863d89aca162.zip
Initial commit
Diffstat (limited to 'gamemode/shared/entity_ext.lua')
-rw-r--r--gamemode/shared/entity_ext.lua19
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