Skip to content

Commit 1eb6d12

Browse files
AstralcircleFPtje
authored andcommitted
Optimize ENTITY:FireBullets
1 parent 1ef8894 commit 1eb6d12

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

lua/fpp/server/core.lua

+7-2
Original file line numberDiff line numberDiff line change
@@ -688,11 +688,16 @@ end
688688
hook.Add("PlayerInitialSpawn", "FPP.PlayerInitialSpawn", FPP.PlayerInitialSpawn)
689689

690690
local backup = ENTITY.FireBullets
691-
local blockedEffects = {"particleeffect", "smoke", "vortdispel", "helicoptermegabomb"}
691+
local blockedEffects = {
692+
["particleeffect"] = true,
693+
["smoke"] = true,
694+
["vortdispel"] = true,
695+
["helicoptermegabomb"] = true,
696+
}
692697

693698
function ENTITY:FireBullets(bullet, ...)
694699
if not bullet.TracerName then return backup(self, bullet, ...) end
695-
if table.HasValue(blockedEffects, string.lower(bullet.TracerName)) then
700+
if blockedEffects[string.lower(bullet.TracerName)] then
696701
bullet.TracerName = ""
697702
end
698703
return backup(self, bullet, ...)

0 commit comments

Comments
 (0)