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
4 changes: 0 additions & 4 deletions lua/entities/base_wire_entity.lua
Original file line number Diff line number Diff line change
Expand Up @@ -456,10 +456,6 @@ if SERVER then
end
end

function ENT:OnRemove()
WireLib.Remove(self)
end

function ENT:OnRestore()
WireLib.Restored(self)
end
Expand Down
1 change: 1 addition & 0 deletions lua/entities/gmod_wire_adv_emarker.lua
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ end

function ENT:OnRemove()
self:ClearEntities()
BaseClass.OnRemove(self)
end

function ENT:BuildDupeInfo()
Expand Down
1 change: 1 addition & 0 deletions lua/entities/gmod_wire_buoyancy.lua
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ end

function ENT:OnRemove()
self:ClearEntities()
BaseClass.OnRemove(self)
end

function ENT:BuildDupeInfo()
Expand Down
1 change: 1 addition & 0 deletions lua/entities/gmod_wire_cameracontroller.lua
Original file line number Diff line number Diff line change
Expand Up @@ -675,6 +675,7 @@ function ENT:OnRemove()
end

self:ClearEntities()
BaseClass.OnRemove(self)
end

--------------------------------------------------
Expand Down
2 changes: 2 additions & 0 deletions lua/entities/gmod_wire_characterlcd/cl_init.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
include("shared.lua")

DEFINE_BASECLASS("base_wire_entity")

function ENT:Initialize()
local mem = {}
Expand Down Expand Up @@ -119,6 +120,7 @@ end

function ENT:OnRemove()
self.GPU:Finalize()
BaseClass.OnRemove(self)
end

function ENT:ReadCell(Address,value)
Expand Down
2 changes: 2 additions & 0 deletions lua/entities/gmod_wire_clutch.lua
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,8 @@ function ENT:OnRemove()
for k in pairs( self.clutch_ballsockets ) do
self:RemoveClutch( k )
end

BaseClass.OnRemove(self)
end


Expand Down
6 changes: 3 additions & 3 deletions lua/entities/gmod_wire_consolescreen/cl_init.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
include("shared.lua")

DEFINE_BASECLASS("base_wire_entity")

function ENT:SendData()
net.Start("wire_interactiveprop_action")

Expand Down Expand Up @@ -134,6 +136,7 @@ end
function ENT:OnRemove()
self.GPU:Finalize()
self.NeedRefresh = true
BaseClass.OnRemove(self)
end

function ENT:ReadCell(Address,value)
Expand Down Expand Up @@ -729,6 +732,3 @@ end
function ENT:IsTranslucent()
return true
end



2 changes: 2 additions & 0 deletions lua/entities/gmod_wire_datasocket.lua
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ if CLIENT then
if #sockets == 0 then
hook.Remove("HUDPaint", "Wire_DataSocket_DrawLinkHelperLine")
end

BaseClass.OnRemove(self)
end

return
Expand Down
3 changes: 2 additions & 1 deletion lua/entities/gmod_wire_digitalscreen/cl_init.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
include("shared.lua")


DEFINE_BASECLASS("base_wire_entity")

function ENT:SendData()
net.Start("wire_interactiveprop_action")
Expand Down Expand Up @@ -78,6 +78,7 @@ end
function ENT:OnRemove()
self.GPU:Finalize()
self.NeedRefresh = true
BaseClass.OnRemove(self)
end

local function stringToNumber(index, str, bytes)
Expand Down
2 changes: 2 additions & 0 deletions lua/entities/gmod_wire_egp/cl_init.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
include('shared.lua')

DEFINE_BASECLASS("base_wire_entity")
ENT.gmod_wire_egp = true

function ENT:Initialize()
Expand Down Expand Up @@ -49,4 +50,5 @@ end

function ENT:OnRemove()
self.GPU:Finalize()
BaseClass.OnRemove(self)
end
1 change: 1 addition & 0 deletions lua/entities/gmod_wire_egp_emitter.lua
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ if CLIENT then

function ENT:OnRemove()
if self.GPU then self.GPU:Finalize() end
BaseClass.OnRemove(self)
end
end

Expand Down
1 change: 1 addition & 0 deletions lua/entities/gmod_wire_egp_hud/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ end

function ENT:OnRemove()
EGP:UnlinkHUDFromVehicle( self )
BaseClass.OnRemove(self)
end

function ENT:BuildDupeInfo()
Expand Down
2 changes: 2 additions & 0 deletions lua/entities/gmod_wire_emarker.lua
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ function ENT:OnRemove()
self.Mark:RemoveCallOnRemove("EMarker.UnLink" .. self:EntIndex())
self.Mark = nil
end

BaseClass.OnRemove(self)
end

function ENT:BuildDupeInfo()
Expand Down
1 change: 1 addition & 0 deletions lua/entities/gmod_wire_eyepod.lua
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ end)

function ENT:OnRemove()
self:UnlinkEnt()
BaseClass.OnRemove(self)
end

local function AngNorm(Ang)
Expand Down
1 change: 1 addition & 0 deletions lua/entities/gmod_wire_freezer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ end

function ENT:OnRemove()
self:ClearEntities()
BaseClass.OnRemove(self)
end

function ENT:BuildDupeInfo()
Expand Down
2 changes: 2 additions & 0 deletions lua/entities/gmod_wire_gpu/cl_init.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
include("cl_gpuvm.lua")
include("shared.lua")

DEFINE_BASECLASS("base_wire_entity")
local Monitors = {}
local MonitorLookup = {}
local HUDLookup = {}
Expand Down Expand Up @@ -134,6 +135,7 @@ function ENT:OnRemove()
GPULib.ClientCacheCallback(self,nil)
self.GPU:Finalize()
if self.SpriteGPU then self.SpriteGPU:Finalize() end
BaseClass.OnRemove(self)
end


Expand Down
2 changes: 1 addition & 1 deletion lua/entities/gmod_wire_grabber.lua
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function ENT:OnRemove()
if self.Weld then
self:ResetGrab()
end
Wire_Remove(self)
BaseClass.OnRemove(self)
end

function ENT:Setup(Range, Gravity)
Expand Down
1 change: 1 addition & 0 deletions lua/entities/gmod_wire_graphics_tablet.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

ENT.workingDistance = 64

local SCREEN_CURSOR = false -- (0, 0) is top left, (1, 1) is bottom right

Check warning on line 10 in lua/entities/gmod_wire_graphics_tablet.lua

View workflow job for this annotation

GitHub Actions / lint

"Unused variable"

Unused variable: SCREEN_CURSOR
local GRAPH_CURSOR = true -- (0, 0) is center, (1, 1) is top right

function ENT:SetupDataTables()
Expand All @@ -24,6 +24,7 @@

function ENT:OnRemove()
self.GPU:Finalize()
BaseClass.OnRemove(self)
end

local function cut_rect(x1,y1,w1,h1,x2,y2,w2,h2)
Expand All @@ -36,7 +37,7 @@
function ENT:Draw(flags)
self:DrawModel(flags)

local draw_background = self:GetDrawBackground()

Check warning on line 40 in lua/entities/gmod_wire_graphics_tablet.lua

View workflow job for this annotation

GitHub Actions / lint

"Deprecated"

Deprecated: Use :GetPaintBackground instead
self.GPU:RenderToWorld(nil, 512, function(x, y, w, h, monitor, pos, ang, res)
if draw_background then
surface.SetDrawColor(0, 0, 0, 255)
Expand Down Expand Up @@ -110,8 +111,8 @@
local pos = GPUEntity:LocalToWorld(monitor.offset)
local h = 1024
local w = h/monitor.RatioX
local x = -w/2

Check warning on line 114 in lua/entities/gmod_wire_graphics_tablet.lua

View workflow job for this annotation

GitHub Actions / lint

"Unused variable"

Unused variable: x
local y = -h/2

Check warning on line 115 in lua/entities/gmod_wire_graphics_tablet.lua

View workflow job for this annotation

GitHub Actions / lint

"Unused variable"

Unused variable: y

for _,ply in player.Iterator() do
local trace = ply:GetEyeTraceNoCursor()
Expand Down
2 changes: 2 additions & 0 deletions lua/entities/gmod_wire_hdd.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ function ENT:OnRemove()
for k,v in pairs(self.CacheUpdated) do
file.Write(self:GetStructName(k),self:MakeFloatTable(self.Cache[k]))
end

BaseClass.OnRemove(self)
end

function ENT:Initialize()
Expand Down
1 change: 1 addition & 0 deletions lua/entities/gmod_wire_interactiveprop.lua
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,7 @@ end

function ENT:OnRemove()
self:Unprompt( true )
BaseClass.OnRemove(self)
end


Expand Down
2 changes: 2 additions & 0 deletions lua/entities/gmod_wire_lamp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -144,13 +144,15 @@
self.LastLampMatrix = nil
self.LastLampColor = nil
end

BaseClass.OnRemove(self)
end

return
end

function ENT:TriggerInput(name, value)
local color = self:GetColor()

Check warning on line 155 in lua/entities/gmod_wire_lamp.lua

View workflow job for this annotation

GitHub Actions / lint

"Unused variable"

Unused variable: color

if name == "On" then
self:SetOn(value ~= 0)
Expand Down
1 change: 1 addition & 0 deletions lua/entities/gmod_wire_latch.lua
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ end
function ENT:OnRemove()
self:TriggerInput("Activate", 0)
self:TriggerInput("NoCollide", 0)
BaseClass.OnRemove(self)
end

function ENT:UpdateOverlay()
Expand Down
2 changes: 2 additions & 0 deletions lua/entities/gmod_wire_numpad.lua
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ function ENT:OnRemove()
for _,impulse in ipairs(self.impulses) do
numpad.Remove(impulse)
end

BaseClass.OnRemove(self)
end

local function On( pl, ent, key )
Expand Down
1 change: 1 addition & 0 deletions lua/entities/gmod_wire_oscilloscope.lua
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ if CLIENT then

function ENT:OnRemove()
self.GPU:Finalize()
BaseClass.OnRemove(self)
end

function ENT:GetNodeList()
Expand Down
1 change: 1 addition & 0 deletions lua/entities/gmod_wire_pod.lua
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@ function ENT:OnRemove()
hook.Remove("PlayerLeaveVehicle", "Wire_Pod_ExitVehicle")
hook.Remove("CanExitVehicle","Wire_Pod_CanExitVehicle")
end
BaseClass.OnRemove(self)
end

function ENT:GetPod()
Expand Down
6 changes: 4 additions & 2 deletions lua/entities/gmod_wire_rt_camera.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
AddCSLuaFile()
ENT.Base = "base_wire_entity"
ENT.Type = "anim"

DEFINE_BASECLASS("base_wire_entity")
ENT.PrintName = "Improved RT Camera"
ENT.WireDebugName = "Improved RT Camera"

Expand Down Expand Up @@ -89,6 +89,8 @@
if not fullUpdate then
SetCameraActive(self, false)
end

BaseClass.OnRemove(self)
end

function ENT:SetIsObserved(isObserved)
Expand Down Expand Up @@ -172,7 +174,7 @@
local renderedCameras = 0

for _, ent in ipairs(ActiveCameras) do
if not IsValid(ent) or not ent.IsObserved then goto next_camera end

Check warning on line 177 in lua/entities/gmod_wire_rt_camera.lua

View workflow job for this annotation

GitHub Actions / lint

"Goto"

Don't use labels and gotos unless you're jumping out of multiple loops.
renderedCameras = renderedCameras + 1

render.PushRenderTarget(ent.RenderTarget)
Expand Down
4 changes: 2 additions & 2 deletions lua/entities/gmod_wire_rt_screen.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
AddCSLuaFile()

ENT.Type = "anim"
ENT.Base = "base_wire_entity"
DEFINE_BASECLASS("base_wire_entity")
ENT.PrintName = "Improved RT Screen"
ENT.WireDebugName = "Improved RT Screen"

Expand Down Expand Up @@ -131,6 +130,7 @@ if SERVER then
if #screens == 0 then
hook.Remove("SetupPlayerVisibility", "ImprovedRTCamera")
end
BaseClass.OnRemove(self)
end

end
Expand Down
1 change: 1 addition & 0 deletions lua/entities/gmod_wire_screen.lua
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ if CLIENT then

function ENT:OnRemove()
self.GPU:Finalize()
BaseClass.OnRemove(self)
end

local large_font = "Trebuchet36"
Expand Down
1 change: 1 addition & 0 deletions lua/entities/gmod_wire_socket.lua
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ if CLIENT then
if #sockets == 0 then
hook.Remove("HUDPaint", "Wire_Socket_DrawLinkHelperLine")
end
BaseClass.OnRemove(self)
end

return -- No more client
Expand Down
1 change: 1 addition & 0 deletions lua/entities/gmod_wire_spawner.lua
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ function ENT:OnRemove()
for _,ent in ipairs(self.UndoList) do
GlobalUndoList[ent] = nil
end
BaseClass.OnRemove(self)
end

duplicator.RegisterEntityClass("gmod_wire_spawner", WireLib.MakeWireEnt, "Data", "delay", "undo_delay", "spawn_effect", "mat", "r", "g", "b", "a", "skin")
3 changes: 2 additions & 1 deletion lua/entities/gmod_wire_spu/cl_init.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
include("cl_spuvm.lua")
include("shared.lua")


DEFINE_BASECLASS("base_wire_entity")

--------------------------------------------------------------------------------
WireSPU_MaxChannels = 32
Expand Down Expand Up @@ -150,6 +150,7 @@ function ENT:OnRemove()
v.Sound:Stop()
end
end
BaseClass.OnRemove(self)
end


Expand Down
1 change: 1 addition & 0 deletions lua/entities/gmod_wire_spu/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
function()
if not self:IsValid() then return end

umsg.Start("wire_spu_soundsources")

Check warning on line 54 in lua/entities/gmod_wire_spu/init.lua

View workflow job for this annotation

GitHub Actions / lint

"Deprecated"

Deprecated: Use net messages.
umsg.Long(self:EntIndex())
for i=0,WireSPU_MaxChannels-1 do
umsg.Long(self.SoundSources[i]:EntIndex())
Expand All @@ -69,6 +69,7 @@
for i=0,WireSPU_MaxChannels-1 do
self.SoundSources[i]:Remove()
end
BaseClass.OnRemove(self)
end


Expand All @@ -93,7 +94,7 @@
function()
if not self:IsValid() then return end

umsg.Start("wire_spu_memorymodel")

Check warning on line 97 in lua/entities/gmod_wire_spu/init.lua

View workflow job for this annotation

GitHub Actions / lint

"Deprecated"

Deprecated: Use net messages.
umsg.Long(self:EntIndex())
umsg.Long (self.RAMSize)
umsg.Float(self.SerialNo)
Expand All @@ -109,7 +110,7 @@
function()
if not self:IsValid() then return end

umsg.Start("wire_spu_extensions")

Check warning on line 113 in lua/entities/gmod_wire_spu/init.lua

View workflow job for this annotation

GitHub Actions / lint

"Deprecated"

Deprecated: Use net messages.
umsg.Long(self:EntIndex())
umsg.String(self.ZVMExtensions)
umsg.End()
Expand Down Expand Up @@ -336,7 +337,7 @@

-- Send update to all clients
if soundEmittersChanged then
umsg.Start("wire_spu_soundstate")

Check warning on line 340 in lua/entities/gmod_wire_spu/init.lua

View workflow job for this annotation

GitHub Actions / lint

"Deprecated"

Deprecated: Use net messages.
umsg.Long(self:EntIndex())
umsg.Short(#self.SoundEmitters)
for idx=1,#self.SoundEmitters do
Expand Down
3 changes: 2 additions & 1 deletion lua/entities/gmod_wire_textentry.lua
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ function ENT:OnRemove()
self:RemoveHoldTimer()

self:Unprompt( true )
BaseClass.OnRemove(self)
end

----------------------------------------------------
Expand All @@ -186,7 +187,7 @@ net.Receive("wire_textentry_action",function(len,ply)
if ok and not self.BlockInput then
self:OnTextEntered(text)


end

self:UpdateOverlay()
Expand Down
1 change: 1 addition & 0 deletions lua/entities/gmod_wire_textreceiver.lua
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ end

function ENT:OnRemove()
RemoveReceiver( self )
BaseClass.OnRemove(self)
end

local string_find = string.find
Expand Down
1 change: 1 addition & 0 deletions lua/entities/gmod_wire_textscreen.lua
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ if CLIENT then
self.NeedRefresh = true
if fullUpdate then return end
self.GPU:Finalize()
BaseClass.OnRemove(self)
end
function ENT:Draw(flags)
self:DrawModel(flags)
Expand Down
2 changes: 2 additions & 0 deletions lua/entities/gmod_wire_waypoint.lua
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ function ENT:OnRemove()
ent:SetNextWaypoint(ent:GetNextWaypoint())
end
end

BaseClass.OnRemove(self)
end

duplicator.RegisterEntityClass("gmod_wire_waypoint", WireLib.MakeWireEnt, "Data", "range")
Loading
Loading