Open unknown-gd opened 5 months ago
Details
I recently found an really weird bug with glua,
Player:IsSpeaking()
starts lying at random times and returns wrongtrue
/false
values, works only if you have other players on the server and they are actively using voice chat, according to my tests it happened mostly with local player on the client side, insandbox
and other gamemodes it is not noticeable because they use theGM:PlayerStartVoice
&GM:PlayerEndVoice
hooks instead of this function.Branch:
main
Steps to reproduce
- Find a few players for the tests
- Create a hook in HudPaint that will draw a green rect when you speak, using
LocalPlayer():IsSpeaking()
- Play and talk with other players
- At one point in time, the indicator turns green at all times, giving false information.
I played for roughly 40~ some odd minutes on a DarkRP server with a Lua executor running this code:
-- Cache our LocalPlayer and color variable
local Local, Green = LocalPlayer( ), Color( 0, 255, 0 )
hook.Add( "HUDPaint", "DrawRectBox", function()
if Local:IsSpeaking( ) then
surface.SetDrawColor( Green )
surface.DrawRect( ScrW( ) / 1.5, 50, 250, 150 )
end
end )
And I couldn't reproduce the bug even after adding fake lag and other lag elements to my game on purpose. Tested between 40-480ms and 20-400 FPS.
Details
I recently found an really weird bug with glua,
Player:IsSpeaking()
starts lying at random times and returns wrongtrue
/false
values, works only if you have other players on the server and they are actively using voice chat, according to my tests it happened mostly with local player on the client side, insandbox
and other gamemodes it is not noticeable because they use theGM:PlayerStartVoice
&GM:PlayerEndVoice
hooks instead of this function.Branch:
main
Steps to reproduce
LocalPlayer():IsSpeaking()