Skip to content

Commit 8156473

Browse files
author
BerkieBb
authored
chore(client): Optimize
1 parent ed79a59 commit 8156473

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

client.lua

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ local lastCrossroadCheck = {}
9595

9696
local function getCrossroads(player)
9797
local updateTick = GetGameTimer()
98-
if (updateTick - lastCrossroadUpdate) > 1500 then
98+
if updateTick - lastCrossroadUpdate > 1500 then
9999
local pos = GetEntityCoords(player)
100100
local street1, street2 = GetStreetNameAtCoord(pos.x, pos.y, pos.z)
101101
lastCrossroadUpdate = updateTick
@@ -132,12 +132,13 @@ CreateThread(function()
132132
if LocalPlayer.state.isLoggedIn then
133133
local show = true
134134
local player = PlayerPedId()
135+
local playerId = PlayerId()
135136
-- player hud
136-
local oxygen = GetPlayerUnderwaterTimeRemaining(PlayerId()) * 10
137-
local stamina = GetPlayerSprintStaminaRemaining(PlayerId()) * 1
138-
local talking = NetworkIsPlayerTalking(PlayerId())
137+
local oxygen = GetPlayerUnderwaterTimeRemaining(playerId) * 10
138+
local stamina = GetPlayerSprintStaminaRemaining(playerId)
139+
local talking = NetworkIsPlayerTalking(playerId)
139140
local voice = 0
140-
if LocalPlayer.state['proximity'] ~= nil then
141+
if LocalPlayer.state['proximity'] then
141142
voice = LocalPlayer.state['proximity'].distance
142143
end
143144
if IsPauseMenuActive() then
@@ -152,7 +153,6 @@ CreateThread(function()
152153
stress,
153154
oxygen,
154155
stamina,
155-
talking,
156156
voice,
157157
LocalPlayer.state['radioChannel'],
158158
talking

0 commit comments

Comments
 (0)