Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions lua/wire/stools/clutch.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,10 @@

if SERVER then
CreateConVar( "wire_clutch_maxlinks", 10 ) -- how many constraints can be added per controller
CreateConVar( "wire_clutch_maxrate", 40 ) -- how many constraints/sec may be changed per controller

Check warning on line 19 in lua/wire/stools/clutch.lua

View workflow job for this annotation

GitHub Actions / lint

"Syntax inconsistency"

Inconsistent use of '//' and '--'
end

TOOL.ClientConVar[ "model" ] = "models/jaanus/wiretool/wiretool_siren.mdl"
cleanup.Register( "wire_clutch" )


/*---------------------------------------------------------
-- Server Usermessages --
Expand All @@ -30,9 +28,9 @@
local Send_Links

if SERVER then
// Send info: constraints associated with the selected clutch controller

Check warning on line 31 in lua/wire/stools/clutch.lua

View workflow job for this annotation

GitHub Actions / lint

"Syntax inconsistency"

Inconsistent use of '//' and '--'
Send_Links = function( ply, constrained_pairs )
umsg.Start( "wire_clutch_links", ply )

Check warning on line 33 in lua/wire/stools/clutch.lua

View workflow job for this annotation

GitHub Actions / lint

"Deprecated"

Deprecated: Use net messages.
local num_constraints = #constrained_pairs
umsg.Short( num_constraints )

Expand All @@ -51,9 +49,9 @@
---------------------------------------------------------*/
if CLIENT then
local Linked_Ents = {} -- Table of constrained ents, with Ent1 as k and Ent2 as v
local Unique_Ents = {} -- Table of entities as keys

Check warning on line 52 in lua/wire/stools/clutch.lua

View workflow job for this annotation

GitHub Actions / lint

"Syntax inconsistency"

Inconsistent use of '//' and '--'

// Receive stage 0 info

Check warning on line 54 in lua/wire/stools/clutch.lua

View workflow job for this annotation

GitHub Actions / lint

"Syntax inconsistency"

Inconsistent use of '//' and '--'
local function Receive_links( um )
table.Empty( Linked_Ents )
local num_constraints = um:ReadShort() or 0
Expand Down Expand Up @@ -97,7 +95,7 @@
end


// Client function for drawing a circle around the currently selected controller

Check warning on line 98 in lua/wire/stools/clutch.lua

View workflow job for this annotation

GitHub Actions / lint

"Syntax inconsistency"

Inconsistent use of '--' and '//'
local function DrawSelectCircle( pos, viewpos )
local pos2D = pos:ToScreen()

Expand All @@ -107,7 +105,7 @@
end

function TOOL:DrawHUD()
local DrawnEnts = {} -- Used to keep track of which ents already have a circle

Check warning on line 108 in lua/wire/stools/clutch.lua

View workflow job for this annotation

GitHub Actions / lint

"Syntax inconsistency"

Inconsistent use of '--' and '//'

local controller = self:GetWeapon():GetNWEntity( "WireClutchController" )
if not IsValid( controller ) then return end
Expand All @@ -123,7 +121,7 @@
surface.SetDrawColor( 100, 255, 100, 255 )


// Check whether each entity/position can be drawn

Check warning on line 124 in lua/wire/stools/clutch.lua

View workflow job for this annotation

GitHub Actions / lint

"Syntax inconsistency"

Inconsistent use of '--' and '//'
for k, v in pairs( Linked_Ents ) do
local basepos
local pos1, pos2
Expand Down Expand Up @@ -172,7 +170,7 @@
if SERVER then
function TOOL:SelectController( controller )
self.controller = controller
self:GetWeapon():SetNWEntity( "WireClutchController", controller or Entity(0) ) -- Must use null entity since nil won't send

Check warning on line 173 in lua/wire/stools/clutch.lua

View workflow job for this annotation

GitHub Actions / lint

"Syntax inconsistency"

Inconsistent use of '--' and '//'

// Send constraint from the controller to the client
local constrained_pairs = {}
Expand Down Expand Up @@ -217,7 +215,7 @@
end

// Check that we won't be going over the max number of links allowed
local maxlinks = GetConVarNumber( "wire_clutch_maxlinks", 10 )

Check warning on line 218 in lua/wire/stools/clutch.lua

View workflow job for this annotation

GitHub Actions / lint

"Deprecated"

Deprecated: Use ConVar objects instead
if table.Count( self.controller.clutch_ballsockets ) >= maxlinks then
ply:PrintMessage( HUD_PRINTTALK, "A maximum of " .. tostring( maxlinks ) .. " links are allowed per clutch controller" )
return
Expand Down
2 changes: 0 additions & 2 deletions lua/wire/stools/dataplug.lua
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ end

local SocketData = list.Get("Wire_Socket_Models")

cleanup.Register( "wire_dataplugs" )

function TOOL:GetModel()
local model = self:GetClientInfo( "model" )
if (not util.IsValidModel( model ) or not util.IsValidProp( model ) or not SocketData[ model ]) then return "models/props_lab/tpplugholder_single.mdl", "models/props_lab/tpplug.mdl" end
Expand Down
5 changes: 2 additions & 3 deletions lua/wire/stools/egp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,10 @@ TOOL.ClientConVar["freeze"] = 1
TOOL.ClientConVar["emitter_usert"] = 1
TOOL.ClientConVar["translucent"] = 0

cleanup.Register( "wire_egps" )
WireToolSetup.BaseLang()
WireToolSetup.SetupMax(5)

if (SERVER) then
CreateConVar('sbox_maxwire_egps', 5)

local function SpawnEnt( ply, Pos, Ang, model, class)
if IsValid(ply) and (not ply:CheckLimit("wire_egps")) then return false end
if not ply then ply = game.GetWorld() end -- For Garry's Map Saver
Expand Down
2 changes: 0 additions & 2 deletions lua/wire/stools/plug.lua
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ hook.Add("ModelPlugLuaRefresh","wire_plug_updatemodels",function()
SocketData = list.Get("Wire_Socket_Models")
end)

cleanup.Register( "wire_plugs" )

function TOOL:GetModel()
local model = self:GetClientInfo( "model" )
if (not util.IsValidModel( model ) or not util.IsValidProp( model ) or not SocketData[ model ]) then return "models/props_lab/tpplugholder_single.mdl" end
Expand Down
Loading