diff --git a/lua/entities/gmod_wire_expression2/core/custom/cl_prop.lua b/lua/entities/gmod_wire_expression2/core/custom/cl_prop.lua index 35f01a94..44c1c667 100644 --- a/lua/entities/gmod_wire_expression2/core/custom/cl_prop.lua +++ b/lua/entities/gmod_wire_expression2/core/custom/cl_prop.lua @@ -57,6 +57,9 @@ E2Helper.Descriptions["parentTo(e:)"] = E2Helper.Descriptions["parentTo(e:e)"] E2Helper.Descriptions["parentToAttachment(e:es)"] = "Parents one entity to anothers attachment." E2Helper.Descriptions["deparent(e:)"] = "Unparents an entity, so it moves freely again." E2Helper.Descriptions["propBreak(e:)"] = "Breaks/Explodes breakable/explodable props (Useful for Mines)." +E2Helper.Descriptions["propDissolve(e:)"] = "Dissolves the specified entity." +E2Helper.Descriptions["propDissolve(e:n)"] = "Dissolves the specified entity using the given dissolve type (_ENTITY_DISSOLVE)." +E2Helper.Descriptions["propDissolve(e:nn)"] = "Dissolves the specified entity with the given dissolve type (_ENTITY_DISSOLVE) and magnitude." E2Helper.Descriptions["propCanCreate()"] = "Returns 1 when propSpawn() will successfully spawn a prop until the limit is reached." E2Helper.Descriptions["propDrag(e:n)"] = "Passing 0 makes the entity not be affected by drag" E2Helper.Descriptions["propInertia(e:n)"] = "Sets the directional inertia" diff --git a/lua/entities/gmod_wire_expression2/core/custom/prop.lua b/lua/entities/gmod_wire_expression2/core/custom/prop.lua index 242a8bb0..721d44a8 100644 --- a/lua/entities/gmod_wire_expression2/core/custom/prop.lua +++ b/lua/entities/gmod_wire_expression2/core/custom/prop.lua @@ -61,7 +61,7 @@ local ValidSpawn = PropCore.ValidSpawn local canHaveInvalidPhysics = { delete=true, parent=true, deparent=true, solid=true, shadow=true, draw=true, use=true, pos=true, ang=true, - manipulate=true, noDupe=true + manipulate=true, noDupe=true, dissolve=true } function PropCore.ValidAction(self, entity, cmd, bone) @@ -714,6 +714,26 @@ e2function void entity:propBreak() this:Fire("break",1,0) end +E2Lib.registerConstant("ENTITY_DISSOLVE_NORMAL", 0) +E2Lib.registerConstant("ENTITY_DISSOLVE_ELECTRICAL", 1) +E2Lib.registerConstant("ENTITY_DISSOLVE_ELECTRICAL_LIGHT", 2) +E2Lib.registerConstant("ENTITY_DISSOLVE_CORE", 3) + +e2function void entity:propDissolve() + if not ValidAction(self, this, "dissolve") then return end + this:Dissolve() +end + +e2function void entity:propDissolve(number dissolvetype) + if not ValidAction(self, this, "dissolve") then return end + this:Dissolve(dissolvetype) +end + +e2function void entity:propDissolve(number dissolvetype, number magnitude) + if not ValidAction(self, this, "dissolve") then return end + this:Dissolve(dissolvetype, magnitude) +end + e2function void entity:use() if not ValidAction(self, this, "use") then return end