From 623ce38a3735c122dd49080f57a71c94355ec816 Mon Sep 17 00:00:00 2001 From: Linden <65407488+thelindat@users.noreply.github.com> Date: Tue, 14 May 2024 04:12:21 +1000 Subject: [PATCH] fix(client/api): early return when setting player options Resolves #146. --- client/api.lua | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/client/api.lua b/client/api.lua index 1c3fa25..7047749 100644 --- a/client/api.lua +++ b/client/api.lua @@ -432,12 +432,12 @@ end function options_mt:set(entity, _type, model) if not entity then return options end - if _type == 1 then - if IsPedAPlayer(entity) then - self:wipe() - self.globalTarget = players - options_mt.size += 1 - end + if _type == 1 and IsPedAPlayer(entity) then + self:wipe() + self.globalTarget = players + options_mt.size += 1 + + return end local netId = NetworkGetEntityIsNetworked(entity) and NetworkGetNetworkIdFromEntity(entity)