diff --git a/lua/entities/base_glide_aircraft/cl_init.lua b/lua/entities/base_glide_aircraft/cl_init.lua index b1ad905..9ce0f7e 100644 --- a/lua/entities/base_glide_aircraft/cl_init.lua +++ b/lua/entities/base_glide_aircraft/cl_init.lua @@ -43,7 +43,7 @@ local function DrawLight( id, pos, color, size ) dl.b = color.b dl.brightness = 5 dl.decay = 1000 - dl.size = size or 70 + dl.size = size dl.dietime = CurTime() + 0.05 end end @@ -62,14 +62,17 @@ function ENT:OnUpdateMisc() t = t % 1 for i, v in ipairs( self.StrobeLights ) do - on = t > v.blinkTime and t < v.blinkTime + 0.05 + on = t > v.blinkTime and t < v.blinkTime + ( v.blinkDuration or 0.05 ) if on then pos = self:LocalToWorld( v.offset ) color = self.StrobeLightColors[i] - DrawLight( self:EntIndex() + i, pos, color, 80 ) - DrawLightSprite( pos, nil, 30, color ) + if self.StrobeLightRadius > 0 then + DrawLight( self:EntIndex() + i, pos, color, self.StrobeLightRadius ) + end + + DrawLightSprite( pos, nil, self.StrobeLightSpriteSize, color ) end end end diff --git a/lua/entities/base_glide_aircraft/shared.lua b/lua/entities/base_glide_aircraft/shared.lua index 65ece8f..c5e7bd0 100644 --- a/lua/entities/base_glide_aircraft/shared.lua +++ b/lua/entities/base_glide_aircraft/shared.lua @@ -33,12 +33,15 @@ if CLIENT then -- This should countain a table of tables, where each looks like this: -- -- { offset = Vector( 0, 0, 0 ), blinkTime = 0 }, -- Blinks at the start of the cycle - -- { offset = Vector( 0, 0, 0 ), blinkTime = 0.5 }, -- Blinks in the middle of the cycle + -- { offset = Vector( 0, 0, 0 ), blinkTime = 0.5, blinkDuration = 0.5 }, -- Blinks in the middle of the cycle, for half of the cycle -- -- Also note that the table count here should be less than or equal to -- the color count on `ENT.StrobeLightColors`. ENT.StrobeLights = {} + ENT.StrobeLightRadius = 80 + ENT.StrobeLightSpriteSize = 30 + ENT.StrobeLightColors = { Color( 255, 255, 255 ), Color( 255, 0, 0 ),