File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
lua/pac3/core/client/parts Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -76,6 +76,10 @@ BUILDER:StartStorableVars()
7676
7777BUILDER :EndStorableVars ()
7878
79+ function PART :Initialize ()
80+ self .number_particles = 0
81+ end
82+
7983function PART :GetNiceName ()
8084 local str = (self :GetMaterial ()):match (" .+/(.+)" ) or " "
8185 -- return pac.PrettifyName("/".. str) or "error"
@@ -165,10 +169,10 @@ function PART:OnShow(from_rendering)
165169end
166170
167171function PART :OnDraw ()
168- self .number_particles = self .NumberParticles
172+ self .number_particles = self .NumberParticles or 0
169173 if not self .FireOnce then
170174 if self .Decay == 0 then
171- self .number_particles = self .NumberParticles
175+ self .number_particles = self .NumberParticles or 0
172176 elseif self .Decay > 0 then
173177 self .number_particles = math .Clamp (self .NumberParticles - (RealTime () - self .FirstShotTime ) * self .Decay ,0 ,self .NumberParticles )
174178 else
@@ -243,6 +247,7 @@ function PART:SetMaterial(var)
243247end
244248
245249function PART :EmitParticles (pos , ang , real_ang )
250+ self .number_particles = self .number_particles or 0
246251 if self .FireOnce and not self .FirstShot then self .CanKeepFiring = false end
247252 local emt = self :GetEmitter ()
248253 if not emt then return end
You can’t perform that action at this time.
0 commit comments