Skip to content
This repository has been archived by the owner on Dec 19, 2022. It is now read-only.

Commit

Permalink
fix(client): EnableTarget in a thread
Browse files Browse the repository at this point in the history
Calling yielding functions inside a command will cause silent errors.
  • Loading branch information
thelindat committed Aug 4, 2022
1 parent 30afa03 commit 0dacab4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions client.lua
Original file line number Diff line number Diff line change
Expand Up @@ -511,13 +511,15 @@ if Config.Toggle then
if targetActive then
DisableTarget(true)
else
EnableTarget()
CreateThread(EnableTarget)
end
end, false)
RegisterKeyMapping("playerTarget", "Toggle targeting~", "keyboard", Config.OpenKey)
TriggerEvent('chat:removeSuggestion', '/playerTarget')
else
RegisterCommand('+playerTarget', EnableTarget, false)
RegisterCommand('+playerTarget', function()
CreateThread(EnableTarget)
end, false)
RegisterCommand('-playerTarget', DisableTarget, false)
RegisterKeyMapping("+playerTarget", "Enable targeting~", "keyboard", Config.OpenKey)
TriggerEvent('chat:removeSuggestion', '/+playerTarget')
Expand Down

0 comments on commit 0dacab4

Please sign in to comment.