Skip to content

Commit

Permalink
fix: infinite loop of death
Browse files Browse the repository at this point in the history
  • Loading branch information
TonybynMp4 committed Mar 4, 2024
1 parent e1cfd66 commit d5d0f98
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion server/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ end)
AddStateBagChangeHandler('alcohol', nil, function(bagName, _, value)
local source = GetPlayerFromStateBagName(bagName)
if source == 0 then return end
local player = exports.qbx_core:GetPlayer(source)
if value == Player(source).state.alcohol then return end
local player = exports.qbx_core:GetPlayer(source)
if not player then return end
player.Functions.SetMetaData('alcohol', value)
end)

0 comments on commit d5d0f98

Please sign in to comment.