From eef29d104833b29e59c88449520a7a9fdf61ed66 Mon Sep 17 00:00:00 2001 From: connorh315 <37246828+connorh315@users.noreply.github.com> Date: Thu, 6 Aug 2020 12:45:42 +0100 Subject: [PATCH] Fix invisible characterModel When the panel to the left of the characterModel is too small (due to only one row of models for the player to select from) the y will be calculated and set to a negative position. This means that the characterModel will not render at all. Therefore, we clamp the y to be greater than zero to ensure that this doesn't happen. --- .../gamemodes/clockwork/framework/derma/cl_character.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/upload/garrysmod/gamemodes/clockwork/framework/derma/cl_character.lua b/upload/garrysmod/gamemodes/clockwork/framework/derma/cl_character.lua index 683e58a0..95806a45 100644 --- a/upload/garrysmod/gamemodes/clockwork/framework/derma/cl_character.lua +++ b/upload/garrysmod/gamemodes/clockwork/framework/derma/cl_character.lua @@ -207,6 +207,8 @@ function PANEL:FadeInModelPanel(model) y = (panel.y + (panel:GetTall() / 2)) - (self.characterModel:GetTall() / 2); end; + if y < 0 then y = 2 end; + self.characterModel:SetPos(x, y); if (self.characterModel:FadeIn(0.5)) then