Skip to content

Commit

Permalink
Fix "any" taunts not being able to have model replacements
Browse files Browse the repository at this point in the history
  • Loading branch information
Batfoxkid committed Apr 23, 2024
1 parent ae7768b commit 8daf84c
Showing 1 changed file with 20 additions and 24 deletions.
44 changes: 20 additions & 24 deletions addons/sourcemod/scripting/tf2_custom_taunts.sp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

Expand Down

0 comments on commit 8daf84c

Please sign in to comment.