1
0
mirror of https://github.com/CFC-Servers/chucks_weaponry_2.0.git synced 2025-03-04 03:13:12 -05:00

Fix emitter error (#2)

* Fix emitter error

* Fix other error
This commit is contained in:
Redox 2023-09-16 23:13:32 +01:00 committed by GitHub
parent ba9677d8b3
commit 628b49987d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,15 +1,15 @@
include("shared.lua")
function ENT:Initialize()
self.Emitter = ParticleEmitter(self:GetPos())
self.ParticleDelay = 0
end
function ENT:Draw()
self:DrawModel()
end
function ENT:Think()
if not self.Emitter then
self.Emitter = ParticleEmitter(self:GetPos())
self.ParticleDelay = 0
end
if not self.dt.Misfire then
local part = self.Emitter:Add("particle/smokesprites_000" .. math.random(1, 9), self:GetPos())
part:SetStartSize(12)
@ -26,5 +26,7 @@ function ENT:Think()
end
function ENT:OnRemove()
self.Emitter:Finish()
end
if IsValid( self.Emitter ) then
self.Emitter:Finish()
end
end