#include <sourcemod>

#pragma semicolon 1

new const String:PLUGIN_NAME[] = "Fix for surf_lt_unicorn particles";
new const String:PLUGIN_VERSION[] = "1.0";

public Plugin:myinfo =
{
	name = PLUGIN_NAME,
	author = "hlstriker",
	description = "Precaches the particle file for surf_lt_unicorn.",
	version = PLUGIN_VERSION,
	url = "www.swoobles.com"
}

new const String:SZ_PARTICLE_FILE[] = "particles/surf_lt_unicorn_official.pcf";


public OnPluginStart()
{
	CreateConVar("surf_lt_unicorn_particles_ver", PLUGIN_VERSION, PLUGIN_NAME, FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_NOTIFY|FCVAR_PRINTABLEONLY);
}

public OnMapStart()
{
	decl String:szMapName[64];
	GetCurrentMap(szMapName, sizeof(szMapName));
	
	if(StrContains(szMapName, "surf_lt_unicorn", false) != -1)
		PrecacheGeneric(SZ_PARTICLE_FILE, true);
}