Skip to content

Commit

Permalink
Add IsEGP and adjust the ValidEGP function
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonsturgeon committed Dec 31, 2023
1 parent 1a9c6d3 commit 2c3fdb1
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
1 change: 1 addition & 0 deletions lua/entities/gmod_wire_egp/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ AddCSLuaFile("cl_init.lua")
AddCSLuaFile("shared.lua")
include('shared.lua')

Check warning on line 3 in lua/entities/gmod_wire_egp/init.lua

View workflow job for this annotation

GitHub Actions / lint

"Syntax inconsistency"

Inconsistent use of 'single quoted strings' and 'double quoted strings'

ENT.IsEGP = true
ENT.WireDebugName = "E2 Graphics Processor"

function ENT:Initialize()
Expand Down
11 changes: 7 additions & 4 deletions lua/entities/gmod_wire_egp/lib/egplib/usefulfunctions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -228,10 +228,13 @@ end
--------------------------------------------------------
-- Other
--------------------------------------------------------
function EGP:ValidEGP( Ent )
if not IsValid( Ent ) then return false end
local class = Ent:GetClass()
return class == "gmod_wire_egp" or class == "gmod_wire_egp_hud" or class == "gmod_wire_egp_emitter"
do
local GetVar = FindMetaTable( "Entity" ).GetVar

function EGP:ValidEGP( Ent )
if not IsValid( Ent ) then return false end
return GetVar( Ent, "IsEGP", false )
end
end


Expand Down
3 changes: 2 additions & 1 deletion lua/entities/gmod_wire_egp_emitter.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ ENT.PrintName = "Wire E2 Graphics Processor Emitter"
ENT.WireDebugName = "E2 Graphics Processor Emitter"
ENT.RenderGroup = RENDERGROUP_BOTH

ENT.IsEGP = true
ENT.gmod_wire_egp_emitter = true

local DrawOffsetPos = Vector(0, 0, 71)
Expand Down Expand Up @@ -174,4 +175,4 @@ if CLIENT then
end
end

function ENT:UpdateTransmitState() return TRANSMIT_ALWAYS end
function ENT:UpdateTransmitState() return TRANSMIT_ALWAYS end
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 @@ -6,6 +6,7 @@ include("huddraw.lua")

DEFINE_BASECLASS("base_wire_entity")

ENT.IsEGP = true
ENT.WireDebugName = "E2 Graphics Processor HUD"

util.AddNetworkString("EGP_HUD_Use")
Expand Down

0 comments on commit 2c3fdb1

Please sign in to comment.