Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize ENTITY:FireBullets #339

Merged
merged 2 commits into from
Nov 9, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Optimize ENTITY:FireBullets
  • Loading branch information
Astralcircle authored Nov 9, 2024
commit 05b3d1beeb73555dfafddc8fb9a5b22e285cfedd
9 changes: 7 additions & 2 deletions lua/fpp/server/core.lua
Original file line number Diff line number Diff line change
Expand Up @@ -688,11 +688,16 @@
hook.Add("PlayerInitialSpawn", "FPP.PlayerInitialSpawn", FPP.PlayerInitialSpawn)

local backup = ENTITY.FireBullets
local blockedEffects = {"particleeffect", "smoke", "vortdispel", "helicoptermegabomb"}
local blockedEffects = {
["particleeffect"] = true,

Check warning on line 692 in lua/fpp/server/core.lua

View workflow job for this annotation

GitHub Actions / Lint / lint

"Trailing whitespace"

Trailing whitespace
["smoke"] = true,

Check warning on line 693 in lua/fpp/server/core.lua

View workflow job for this annotation

GitHub Actions / Lint / lint

"Trailing whitespace"

Trailing whitespace
["vortdispel"] = true,

Check warning on line 694 in lua/fpp/server/core.lua

View workflow job for this annotation

GitHub Actions / Lint / lint

"Trailing whitespace"

Trailing whitespace
["helicoptermegabomb"] = true,
}

function ENTITY:FireBullets(bullet, ...)
if not bullet.TracerName then return backup(self, bullet, ...) end
if table.HasValue(blockedEffects, string.lower(bullet.TracerName)) then
if blockedEffects[string.lower(bullet.TracerName)] then
bullet.TracerName = ""
end
return backup(self, bullet, ...)
Expand Down
Loading