From c853e586463efa0acdbe50bb605d0eeea074ca66 Mon Sep 17 00:00:00 2001 From: AlmTech Software Date: Sat, 4 Jan 2020 21:30:14 +0100 Subject: [PATCH] Character model bug fix --- gamemode/engine/core/server/sv_player_init.lua | 2 +- gamemode/engine/lib/server/sv_character.lua | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/gamemode/engine/core/server/sv_player_init.lua b/gamemode/engine/core/server/sv_player_init.lua index c9124a2..ba82074 100644 --- a/gamemode/engine/core/server/sv_player_init.lua +++ b/gamemode/engine/core/server/sv_player_init.lua @@ -43,7 +43,7 @@ end function GM:PlayerSpawn( ply ) if( !ply:IsBot() ) then - if( ply.isloaded == true ) then -- replace logic ( reversed ) + if( ply.isloaded == true ) then ply:UnSpectate() setUpPlayer( ply ) else diff --git a/gamemode/engine/lib/server/sv_character.lua b/gamemode/engine/lib/server/sv_character.lua index 87aa5bd..f6a4ad4 100644 --- a/gamemode/engine/lib/server/sv_character.lua +++ b/gamemode/engine/lib/server/sv_character.lua @@ -12,8 +12,12 @@ local function CreateCharTable( args ) local rand = table.Random(Quantum.Classes) local randMdl = rand.Models[ args.gender ][ math.random(1, #rand.Models[ args.gender ]) ] local setMdl - if( args.class == nil ) then setMdl = randMdl end - + if( args.class == nil ) then + setMdl = randMdl + else + setMdl = Quantum.Classes[args.class].Models[args.gender][args.modelIndex] + end + return { name = args.name || "UNKNOWN", class = Quantum.Classes[args.class] || Quantum.Classes[1],