Skip to content
Permalink
Browse files

Update ttt_icon.sp (#421)

If icon is not declared, dont use it.
  • Loading branch information
Prefix authored and Bara committed Aug 27, 2019
1 parent d4cbf3e commit 0897493d5f140b2a10823c9c7d265d53ee32ad8a
Showing with 26 additions and 11 deletions.
  1. +26 −11 addons/sourcemod/scripting/ttt/ttt_icon.sp
@@ -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)
@@ -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);
}

0 comments on commit 0897493

Please sign in to comment.
You can’t perform that action at this time.