From 8daf84c989e97b7bade2eebf86a244c90cb28fd0 Mon Sep 17 00:00:00 2001 From: Batfoxkid Date: Mon, 22 Apr 2024 18:48:14 -0700 Subject: [PATCH] Fix "any" taunts not being able to have model replacements --- .../sourcemod/scripting/tf2_custom_taunts.sp | 44 +++++++++---------- 1 file changed, 20 insertions(+), 24 deletions(-) diff --git a/addons/sourcemod/scripting/tf2_custom_taunts.sp b/addons/sourcemod/scripting/tf2_custom_taunts.sp index ce2d03d..80f1eea 100644 --- a/addons/sourcemod/scripting/tf2_custom_taunts.sp +++ b/addons/sourcemod/scripting/tf2_custom_taunts.sp @@ -54,38 +54,34 @@ enum struct ModelEnum this.Index = kv.GetNum("index"); bool all = StrEqual(this.Match, "any", false); - if(!all) + if(all) + { + this.Match[0] = 0; + } + else { this.Class = TF2_GetClass(this.Match); if(this.Class != TFClass_Unknown) all = true; } - if(all) + kv.GetString("model", this.Replace, sizeof(this.Replace)); + if(this.Replace[0]) { - this.Match[0] = 0; - this.Replace[0] = 0; - } - else - { - kv.GetString("model", this.Replace, sizeof(this.Replace)); - if(this.Replace[0]) - { - ReplaceString(this.Replace, sizeof(this.Replace), "\\", "/"); + ReplaceString(this.Replace, sizeof(this.Replace), "\\", "/"); - if(StrEqual(this.Replace, this.Match, false)) - { - this.Replace[0] = 0; - } - else if(FileExists(this.Replace, true)) - { - PrecacheModel(this.Replace); - } - else - { - LogError("'%s' has missing model '%s'.", this.Match, this.Replace); - this.Replace[0] = 0; - } + if(StrEqual(this.Replace, this.Match, false)) + { + this.Replace[0] = 0; + } + else if(FileExists(this.Replace, true)) + { + PrecacheModel(this.Replace); + } + else + { + LogError("'%s' has missing model '%s'.", this.Match, this.Replace); + this.Replace[0] = 0; } }