Skip to content

Commit

Permalink
Merge pull request #22 from dvdvideo1234/e2-ext-updt
Browse files Browse the repository at this point in the history
Fixed: Use the new wire vararg to avoid deprecation
  • Loading branch information
shadowscion authored Dec 9, 2023
2 parents b612d68 + 96972b6 commit e76fcf6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
E2Helper.Descriptions["primitiveGetVars(e)"] = "Reads primitive shape variables"
E2Helper.Descriptions["primitiveEdit(es...)"] = "Edits a primitive shape entity"
11 changes: 1 addition & 10 deletions lua/entities/gmod_wire_expression2/core/custom/primitive.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ E2Lib.RegisterExtension( "primitive", false, "Allows the manipulation of primiti

local ANTISPAM_UPDATE_DELAY = 0.5


--
local function isValidPrimitive( self, ent )
if not IsValid( ent ) or not scripted_ents.IsBasedOn( ent:GetClass(), "primitive_base" ) then
return false
Expand All @@ -13,7 +11,6 @@ local function isValidPrimitive( self, ent )
return true
end


local function antispam( ent, key )
if not ent.E2PrimitiveAntispam then
ent.E2PrimitiveAntispam = {}
Expand All @@ -36,7 +33,6 @@ local function antispam( ent, key )
return true
end


local e2type = {}
e2type.Vector = function( val )
local a = val[1]
Expand Down Expand Up @@ -73,19 +69,14 @@ local function editVariable( ply, ent, key, val )
hook.Run( "VariableEdited", ent, ply, key, tostring( val ), editor )
end


--
__e2setcost( 15 )

e2function void primitiveEdit( entity ent, string key, ... )
e2function void primitiveEdit( entity ent, string key, ...args )
if not isValidPrimitive( self, ent ) then return end

local args = { ... }
editVariable( self.player, ent, key, args[1] )
end


--
__e2setcost( 30 )

local e2table = { string = "s", number = "n", boolean = "n" }
Expand Down

0 comments on commit e76fcf6

Please sign in to comment.