From 5ec46bb93c6c172b0aae46ba6ecddbc743c4c945 Mon Sep 17 00:00:00 2001 From: Riggs Date: Sat, 22 Jun 2024 03:16:04 +0200 Subject: [PATCH 1/2] Update sh_hooks.lua --- gamemode/core/hooks/sh_hooks.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gamemode/core/hooks/sh_hooks.lua b/gamemode/core/hooks/sh_hooks.lua index 12342d9dd..9ddc2bc65 100644 --- a/gamemode/core/hooks/sh_hooks.lua +++ b/gamemode/core/hooks/sh_hooks.lua @@ -320,6 +320,10 @@ function GM:PlayerSwitchWeapon(client, oldWeapon, weapon) end function GM:PlayerModelChanged(client, model) + if (!model) then + return + end + client.ixAnimModelClass = ix.anim.GetModelClass(model) UpdateAnimationTable(client) From 0e7710c0777d8cb9ade0f9a20ba7d8566867fcfc Mon Sep 17 00:00:00 2001 From: Riggs Date: Sat, 22 Jun 2024 03:16:06 +0200 Subject: [PATCH 2/2] Update sh_anims.lua --- gamemode/core/libs/sh_anims.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gamemode/core/libs/sh_anims.lua b/gamemode/core/libs/sh_anims.lua index 7e9a9d413..95e3c8a8a 100644 --- a/gamemode/core/libs/sh_anims.lua +++ b/gamemode/core/libs/sh_anims.lua @@ -374,6 +374,10 @@ end -- @usage ix.anim.GetModelClass("models/police.mdl") -- > metrocop function ix.anim.GetModelClass(model) + if (!model) then + return + end + model = string.lower(model) local class = translations[model]