aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Pickering <alexandermpickering@gmail.com>2018-01-14 15:38:14 -0500
committerAlexander Pickering <alexandermpickering@gmail.com>2018-01-14 15:38:14 -0500
commit5e4b759e6b4fd8af9e66f76090ee868368bee467 (patch)
tree0f8eded6108928bf0c5b080201af04ed330bb3a5
parentdadd9486581d217c0482ddd639a13b95428e6366 (diff)
downloadartery-5e4b759e6b4fd8af9e66f76090ee868368bee467.tar.gz
artery-5e4b759e6b4fd8af9e66f76090ee868368bee467.tar.bz2
artery-5e4b759e6b4fd8af9e66f76090ee868368bee467.zip
Moved art_chest entity into gamemode folder
Moved the art_chest entity to use the unusual artery system instead of the default entity system.
-rw-r--r--entities/entities/art_chest/shared.lua2
-rw-r--r--gamemode/ents/art_chest/cl_art_chest.lua (renamed from entities/entities/art_chest/cl_init.lua)4
-rw-r--r--gamemode/ents/art_chest/sh_art_chest.lua11
-rw-r--r--gamemode/ents/art_chest/sv_art_chest.lua (renamed from entities/entities/art_chest/init.lua)6
4 files changed, 17 insertions, 6 deletions
diff --git a/entities/entities/art_chest/shared.lua b/entities/entities/art_chest/shared.lua
deleted file mode 100644
index 0038793..0000000
--- a/entities/entities/art_chest/shared.lua
+++ /dev/null
@@ -1,2 +0,0 @@
-ENT.Type = "anim"
-ENT.Base = "base_anim"
diff --git a/entities/entities/art_chest/cl_init.lua b/gamemode/ents/art_chest/cl_art_chest.lua
index e7357ea..6800810 100644
--- a/entities/entities/art_chest/cl_init.lua
+++ b/gamemode/ents/art_chest/cl_art_chest.lua
@@ -1,4 +1,4 @@
-include("shared.lua")
+local ENT = nrequire("sh_art_chest.lua")
--local invfuncs = include("../../../gamemode/shared/inventory_common.lua")
local invfuncs = nrequire("inventory/inventory.lua")
@@ -60,3 +60,5 @@ net.Receive("openchestinv",function(len,ply)
innerpanel.Paint = function( self, w, h ) draw.RoundedBox( 4, 0, 0, w, h, Color( 157, 160, 167 ) ) end
invfuncs.DrawBackpackOnDPanel(innerpanel, chest, 1, what)
end)
+
+scripted_ents.Register(ENT, "art_chest")
diff --git a/gamemode/ents/art_chest/sh_art_chest.lua b/gamemode/ents/art_chest/sh_art_chest.lua
new file mode 100644
index 0000000..1cfd103
--- /dev/null
+++ b/gamemode/ents/art_chest/sh_art_chest.lua
@@ -0,0 +1,11 @@
+local ENT = {}
+
+ENT.Type = "anim"
+ENT.Base = "base_anim"
+
+hook.Add("artery_core_loaded","load_ent_art_chest",function()
+ local e = scripted_ents.Get("base_anim")
+ setmetatable(ENT,e)
+end)
+
+return ENT
diff --git a/entities/entities/art_chest/init.lua b/gamemode/ents/art_chest/sv_art_chest.lua
index 60f82c8..2eeea7b 100644
--- a/entities/entities/art_chest/init.lua
+++ b/gamemode/ents/art_chest/sv_art_chest.lua
@@ -1,6 +1,4 @@
-AddCSLuaFile("cl_init.lua")
-AddCSLuaFile("shared.lua")
-include("shared.lua")
+local ENT = nrequire("sh_art_chest.lua")
local inv = nrequire("inventory/inventory.lua")
local track = nrequire("inventory/sv_invtracker.lua")
@@ -56,3 +54,5 @@ end
function ENT:Use(ply)
self:SendInventory(ply)
end
+
+scripted_ents.Register(ENT, "art_chest")