Skip to content

Commit

Permalink
Update ttt_icon.sp (#421)
Browse files Browse the repository at this point in the history
If icon is not declared, dont use it.
  • Loading branch information
Prefix authored and Bara committed Aug 27, 2019
1 parent d4cbf3e commit 0897493
Showing 1 changed file with 26 additions and 11 deletions.
37 changes: 26 additions & 11 deletions addons/sourcemod/scripting/ttt/ttt_icon.sp
Expand Up @@ -69,22 +69,33 @@ public void OnMapStart()
char sBuffer[PLATFORM_MAX_PATH];

g_cTraitorIcon.GetString(sBuffer, sizeof(sBuffer));
Format(sBuffer, sizeof(sBuffer), "materials/%s.vtf", sBuffer);
AddFileToDownloadsTable(sBuffer);
if (strlen(sBuffer) > 0)
{
Format(sBuffer, sizeof(sBuffer), "materials/%s.vtf", sBuffer);
AddFileToDownloadsTable(sBuffer);
}

g_cTraitorIcon.GetString(sBuffer, sizeof(sBuffer));
Format(sBuffer, sizeof(sBuffer), "materials/%s.vmt", sBuffer);
AddFileToDownloadsTable(sBuffer);
PrecacheModel(sBuffer);

if (strlen(sBuffer) > 0)
{
Format(sBuffer, sizeof(sBuffer), "materials/%s.vmt", sBuffer);
AddFileToDownloadsTable(sBuffer);
PrecacheModel(sBuffer);
}
g_cDetectiveIcon.GetString(sBuffer, sizeof(sBuffer));
Format(sBuffer, sizeof(sBuffer), "materials/%s.vtf", sBuffer);
AddFileToDownloadsTable(sBuffer);
if (strlen(sBuffer) > 0)
{
Format(sBuffer, sizeof(sBuffer), "materials/%s.vtf", sBuffer);
AddFileToDownloadsTable(sBuffer);
}

g_cDetectiveIcon.GetString(sBuffer, sizeof(sBuffer));
Format(sBuffer, sizeof(sBuffer), "materials/%s.vmt", sBuffer);
AddFileToDownloadsTable(sBuffer);
PrecacheModel(sBuffer);
if (strlen(sBuffer) > 0)
{
Format(sBuffer, sizeof(sBuffer), "materials/%s.vmt", sBuffer);
AddFileToDownloadsTable(sBuffer);
PrecacheModel(sBuffer);
}
}

public void OnClientDisconnect(int client)
Expand Down Expand Up @@ -187,11 +198,15 @@ int CreateIcon(int client, int role)
if (role == TTT_TEAM_DETECTIVE)
{
g_cDetectiveIcon.GetString(sBuffer, sizeof(sBuffer));
if (strlen(sBuffer) == 0)
return -1;
Format(sBuffer, sizeof(sBuffer), "%s.vmt", sBuffer);
}
else if (role == TTT_TEAM_TRAITOR)
{
g_cTraitorIcon.GetString(sBuffer, sizeof(sBuffer));
if (strlen(sBuffer) == 0)
return -1;
Format(sBuffer, sizeof(sBuffer), "%s.vmt", sBuffer);
}

Expand Down

0 comments on commit 0897493

Please sign in to comment.