Facepunch / garrysmod-requests

Feature requests for Garry's Mod
84 stars 24 forks source link

Add new argument of Emitsound to stop calling EntityEmitSound hook. #1496

Closed Headshotz closed 4 years ago

Headshotz commented 4 years ago

Add boolean for it because of performance. If you call Emitsound and its will calling EntityEmitSound hook that already edited the pitch, soundlvl and volume from EmitSound for ex, weapons. So this is waste the performance.

Its need set true to stop calling EntityEmitSound hook.

Kefta commented 4 years ago

If you want no perf loss on your server, empty the hook table for EntityEmitSound.

Headshotz commented 4 years ago

No, that's still same ever if it's empty. This is because in c++ that PushEntity, tables and etc still pushing to LUA.

thegrb93 commented 4 years ago

Thats hardly anything

Headshotz commented 4 years ago

Do you believe that? I checked through IDA and its possible.

thegrb93 commented 4 years ago

Besides, it'd be annoying if you wanted to block emitsounds from another addon, but they decided to 'save performance' by making their sound unblockable.

Headshotz commented 4 years ago

Impossible. I don't believe that should break most addons because its nil or false already by default.

thegrb93 commented 4 years ago

That's not what I said. I said it would be annoying to try blocking an addon's sound only to find out that they made it unblockable.

Headshotz commented 4 years ago

I don't think that should block in mostly addons.

thegrb93 commented 4 years ago

The whole point of emitsound is control over whether a sound plays. This request defeats that purpose.

Headshotz commented 4 years ago

Anyways, I'll wait to hear from Gmod devs. If this is not add so I will make a module to detour so not my problem.

robotboy655 commented 4 years ago

This is not a solution for anything.