From 22ddbadd6ebc057aa3c30cd26e62ba42c7a7040c Mon Sep 17 00:00:00 2001 From: Selt <83926739+seltonmt012@users.noreply.github.com> Date: Mon, 27 Jul 2026 02:52:26 +0200 Subject: [PATCH] fix(es_extended/server/main): use the identity sex for the default skin The fallback skin is built from userData.sex, but that field does not exist yet at this point - it is only assigned further down when the identity data is read from the result row. The comparison therefore always ran against nil and every character without a saved skin fell back to the male model. result.sex holds the value already and is used a few lines later, so read it directly. Tested locally on artifact 25770 with a female character whose skin column is empty: the client used to receive skin.sex 0 and spawned as the male model, it now receives 1 and spawns female. A male character with an empty skin column still receives 0. --- [core]/es_extended/server/main.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/[core]/es_extended/server/main.lua b/[core]/es_extended/server/main.lua index 96c5cc64..6b3ea70e 100644 --- a/[core]/es_extended/server/main.lua +++ b/[core]/es_extended/server/main.lua @@ -307,7 +307,7 @@ function loadESXPlayer(identifier, playerId, isNew) userData.coords = json.decode(result.position) or Config.DefaultSpawns[ESX.Math.Random(1,#Config.DefaultSpawns)] -- Skin - userData.skin = (result.skin and result.skin ~= "") and json.decode(result.skin) or { sex = userData.sex == "f" and 1 or 0 } + userData.skin = (result.skin and result.skin ~= "") and json.decode(result.skin) or { sex = result.sex == "f" and 1 or 0 } -- Metadata userData.metadata = (result.metadata and result.metadata ~= "") and json.decode(result.metadata) or {}