zombiesurvival-evolved/gamemodes/zombiesurvival/gamemode/cl_fix_emitters.lua

38 lines
650 B
Lua
Raw Normal View History

2014-10-02 08:49:54 +08:00
AddCSLuaFile()
if _FIXEDEMITTERS_ or not CLIENT then return end
_FIXEDEMITTERS_ = true
local emitter3d, emitter2d
local ParticleEmitterOld = ParticleEmitter
function ParticleEmitter(vec, threedee)
if threedee then
if emitter3d == nil then
emitter3d = ParticleEmitterOld(vec, true)
else
emitter3d:SetPos(vec)
end
return emitter3d
end
if emitter2d == nil then
emitter2d = ParticleEmitterOld(vec)
else
emitter2d:SetPos(vec)
end
return emitter2d
end
local meta = FindMetaTable("CLuaEmitter")
if not meta then return end
local oldadd = meta.Add
function meta:Add(a, b, c)
self:SetPos(b)
return oldadd(self, a, b, c)
end