ParticleEmitter Fix ( CUtlLinkedList overflow )

[lua]-- Safe ParticleEmitter
– do whatever the fuck you want with this.

if SERVER then AddCSLuaFile() return end
if debug.getinfo(ParticleEmitter).source ~= “=[C]” then return end

local engineParticleEmitter = ParticleEmitter
local emitters = {}
function ParticleEmitter(pos, use3D)
use3D = use3D or false
local emitter = emitters[use3D]
if not emitter then
emitter = engineParticleEmitter(pos, use3D)
emitters[use3D] = emitter
end
emitter:SetPos(pos)

return emitter

end[/lua]

This fixes the issue: “CUtlLinkedList overflow! (exhausted index range) (65535)”. Put it in your server’s lua/autorun/ folder.

Posting to a new thread because apparently some little princess cares about 20 lines of his “copyright”, so enjoy having a problem fixed without the risk of receiving DMCA takedown requests.

[editline]aa[/editline]

Instead of using this, you should probably just fix your code instead. When you’re done with a ParticleEmitter you should call CLuaEmitter:Finish() to remove it from memory. ( It’s not garbage collected properly. )

so whats the story behind the DMCAs and the little princess

[editline]asdb[/editline]

never mind, found it, what a tard

This can cause particles to not render properly. Most likely if the particle emitter is being manually drawn. (which is rare though)

True, not sure what recreates the initial bug anyway. Sounds like people creating a huge amount of ParticleEmitters possibly in render hooks?

It just isn’t garbage collected properly. garry told me this, about 6 months ago.


local mt = debug.getregistry().CLuaEmitter
local __gc = mt.__gc

mt.__gc = function(self)
	self:Finish()
	return __gc(self)
end

Just another addition to the list of fixes.

Don’t think it would work. I already call Finish on all my emitters before they would be garbage collected normally and this bug still happens.

If Finish doesn’t work properly, then that’s a serious-ish bug.

Hah. I wrote this EXACT code yesterday ( ma copyright ;-; ), but as Jetboom said, even Finish is broken.

Has this broken with the new GMod update? Or are the actual addons themselves broken?




[ERROR] addons/abyss/lua/abyss/shared/particleemitter_fix.lua:15: Tried to use invalid object (type CLuaEmitter) (Object was NULL or not of the right type)
  1. SetPos - [C]:-1
   2. ParticleEmitter - addons/abyss/lua/abyss/shared/particleemitter_fix.lua:15
    3. unknown - addons/abyss/lua/effects/fadeeffect/init.lua:36




[WAC Aircraft] lua/entities/wac_hc_base/cl_init.lua:561: Tried to use invalid object (type CLuaEmitter) (Object was NULL or not of the right type)
  1. Add - [C]:-1
   2. unknown - lua/entities/wac_hc_base/cl_init.lua:561
    3. DrawModel - [C]:-1
     4. Render - lua/includes/modules/halo.lua:70
      5. v - lua/includes/modules/halo.lua:168
       6. unknown - lua/includes/modules/hook.lua:84


this emitter bug was apparently fixed in the new update

Indeed, but isn’t it perhaps more efficient to just use one lua emitter across the entire game, as this is basically what this fix does.

You can draw emitters in 2d and for that you want your own separate emitter.

Well the scripts gives me error’s
Everything still goes invisble sometimes by who knows what and gives this when it goes invisble
CUtlLinkedList overflow! (exhausted index range) (65535)

:confused:

That’s only if it is caused by particles. The message is a general error for an overflow of some system (particels, materials, etc.).

I just never assign a discrete emitter to an entity or purpose anymore. Whenever I need one, I create one, emit the particles, and call Finish on it. Any other method creates errors or crashes.

Good old zombie survival gamemode (toxsin?) and the bile throwing zombie issue.

The update didnt fix anything i still get this issue.

This is broken, any possibility on a fix? :3 Love scriptfodder by the way Matt

  • Active Addon Purchaser

Stuck in the same boat, been trying to solve this problem for a darkrp server i’m working on for the past month, shit is starting to drive me crazy. Woke up to a ghasty vision of a 3d2d image reading “CUtlLinkedList overflow!”, now i cant even close my eyes without seeing it :open_mouth:

Ive already tried using every available fix on facepunch, even tried removing some of the plugins that use ‘anything’ emitter, but i’m still stuck with this damn error message.