From 781e2cd76c9dd253408ada89b72ec0d324540a37 Mon Sep 17 00:00:00 2001 From: FortyTwoFortyTwo Date: Tue, 15 Aug 2023 22:56:33 +0100 Subject: [PATCH] Fix viewmodel related to Gunslinger --- addons/sourcemod/scripting/superzombiefortress.sp | 2 +- addons/sourcemod/scripting/szf/sdkhook.sp | 3 +-- addons/sourcemod/scripting/szf/viewmodel.sp | 3 +++ 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/addons/sourcemod/scripting/superzombiefortress.sp b/addons/sourcemod/scripting/superzombiefortress.sp index 9b42d7d8..9779190f 100644 --- a/addons/sourcemod/scripting/superzombiefortress.sp +++ b/addons/sourcemod/scripting/superzombiefortress.sp @@ -19,7 +19,7 @@ #include "include/superzombiefortress.inc" -#define PLUGIN_VERSION "4.6.1" +#define PLUGIN_VERSION "4.6.2" #define PLUGIN_VERSION_REVISION "manual" #define MAX_CONTROL_POINTS 8 diff --git a/addons/sourcemod/scripting/szf/sdkhook.sp b/addons/sourcemod/scripting/szf/sdkhook.sp index e721f559..f959597d 100644 --- a/addons/sourcemod/scripting/szf/sdkhook.sp +++ b/addons/sourcemod/scripting/szf/sdkhook.sp @@ -49,10 +49,9 @@ void SDKHook_UnhookClient(int iClient) public Action Client_Spawn(int iClient) { - Classes_SetClient(iClient); - // Reset arms so generated weapons don't get the wrong viewmodel ViewModel_ResetArms(iClient); + Classes_SetClient(iClient); return Plugin_Continue; } diff --git a/addons/sourcemod/scripting/szf/viewmodel.sp b/addons/sourcemod/scripting/szf/viewmodel.sp index c2a43049..c8aaa2a5 100644 --- a/addons/sourcemod/scripting/szf/viewmodel.sp +++ b/addons/sourcemod/scripting/szf/viewmodel.sp @@ -152,6 +152,9 @@ void ViewModel_RemoveWearable(int iClient) void ViewModel_ResetArms(int iClient) { + if (!g_ClientClasses[iClient].bViewModelAnim) + return; // No need to set if we didn't override it to begin with + TFClassType nClass = TF2_GetPlayerClass(iClient); if (!g_sViewModelsArms[nClass][0]) return;