Skip to content

Commit

Permalink
Fix RT Camera OnRemove detection (#3027)
Browse files Browse the repository at this point in the history
* Fix OnRemove detection

* Fix trailing whitespace
  • Loading branch information
wrefgtzweve authored Apr 2, 2024
1 parent c889b71 commit 3051802
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions lua/entities/gmod_wire_rt_camera.lua
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,10 @@ if CLIENT then
SetCameraActive(self, isActive)
end

function ENT:OnRemove()
timer.Simple( 0, function()
if not IsValid(self) then
SetCameraActive(self, false)
end
end)
function ENT:OnRemove(fullUpdate)
if not fullUpdate then
SetCameraActive(self, false)
end
end

function ENT:SetIsObserved(isObserved)
Expand All @@ -112,7 +110,7 @@ if CLIENT then
local oldi = table.RemoveFastByValue(ObservedCameras, self)
if oldi == nil then return end
self.ObservedCamerasIndex = nil

local shifted_cam = ObservedCameras[oldi]
if IsValid(shifted_cam) then
shifted_cam.ObservedCamerasIndex = oldi
Expand Down

0 comments on commit 3051802

Please sign in to comment.