Skip to content

Commit

Permalink
Change GetContraption meta function to something different (#3077)
Browse files Browse the repository at this point in the history
Renamed from ENT:GetContraption() to ENT:GetCameraFilterEntities()

Fixes a conflict with Contraption Framework
- CFW adds a meta function to all entities, ENT:GetContraption, which returns the contraption an entity is a part of
- Prior to this PR, Wire Camera Controllers have a function of the same name that is called nowhere else within wire, and hopefully nowhere outside of wire either. This function serves as a way to get all of the entities part of a vehicle the camera pod is attached to, and then adds on whatever FilterEntities has.
  • Loading branch information
LiddulBOFH authored May 30, 2024
1 parent 6477912 commit 7d6a99d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lua/entities/gmod_wire_cameracontroller.lua
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ function ENT:Initialize()
self.NextGetContraption = 0
self.NextUpdateOutputs = 0

self:GetContraption()
self:GetCameraFilterEntities()

self:ColorByLinkStatus(self.LINK_STATUS_UNLINKED)
end
Expand Down Expand Up @@ -503,7 +503,7 @@ end
-- GetContraption
-- Used in UpdateOutputs to make the traces ignore the contraption
--------------------------------------------------
function ENT:GetContraption()
function ENT:GetCameraFilterEntities()
if CurTime() < self.NextGetContraption then return end
self.NextGetContraption = CurTime() + 5

Expand Down Expand Up @@ -626,7 +626,7 @@ function ENT:Think()
self:SyncPositions()
end

self:GetContraption()
self:GetCameraFilterEntities()
self:UpdateOutputs()

self:NextThink(CurTime())
Expand Down

0 comments on commit 7d6a99d

Please sign in to comment.