Skip to content

Commit c7953bc

Browse files
committed
Small cleanups
1 parent 2e591c2 commit c7953bc

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

lua/entities/gmod_wire_buoyancy.lua

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@ end
5151

5252
-- For some reason, buoyancy is reset by the physgun and gravgun
5353
local function RestoreBuoyancy(ply, ent)
54-
if IsValid(ent.WireBuoyancyController) then
54+
if ent.WireBuoyancyController then
5555
timer.Simple(0 , function()
56-
if not IsValid(ent) or not IsValid(ent.WireBuoyancyController) then return end
56+
if not ent:IsValid() or not ent.WireBuoyancyController then return end
5757
SetBuoyancy(ent, ent.WireBuoyancyController)
5858
end)
5959
end
@@ -79,9 +79,7 @@ function ENT:LinkEnt(ent)
7979
SetBuoyancy(ent, self)
8080

8181
ent:CallOnRemove("WireBuoyancy_Unlink_" .. self:EntIndex(), function(ent)
82-
if self:IsValid() then
83-
self:UnlinkEnt(ent)
84-
end
82+
self:UnlinkEnt(ent)
8583
end)
8684

8785
ent.WireBuoyancyController = self
@@ -118,7 +116,7 @@ function ENT:OnRemove()
118116
end
119117

120118
function ENT:BuildDupeInfo()
121-
local info = BaseClass.BuildDupeInfo(self) or {}
119+
local info = BaseClass.BuildDupeInfo(self)
122120

123121
if #self.Marks > 0 then
124122
local tab = {}
@@ -137,8 +135,6 @@ function ENT:ApplyDupeInfo(ply, ent, info, GetEntByID)
137135
BaseClass.ApplyDupeInfo(self, ply, ent, info, GetEntByID)
138136

139137
if info.marks then
140-
self.Marks = self.Marks or {}
141-
142138
for index, entid in ipairs(info.marks) do
143139
local ent = GetEntByID(entid)
144140

0 commit comments

Comments
 (0)