Fixed errors and missing effects caused by missing sprites on L4D2 (bug 4512, r=fyren).

This commit is contained in:
Nicholas Hastings 2010-07-26 08:15:52 -04:00
parent 4ab3b15efd
commit 28cc96cfd0
4 changed files with 57 additions and 20 deletions

View File

@ -58,11 +58,11 @@ new Handle:hTopMenu = INVALID_HANDLE;
#define SOUND_FREEZE "physics/glass/glass_impact_bullet4.wav"
// Following are model indexes for temp entities
new g_BeamSprite;
new g_BeamSprite2;
new g_HaloSprite;
new g_GlowSprite;
new g_ExplosionSprite;
new g_BeamSprite = -1;
new g_BeamSprite2 = -1;
new g_HaloSprite = -1;
new g_GlowSprite = -1;
new g_ExplosionSprite = -1;
// Basic color arrays for temp entities
new redColor[4] = {255, 75, 75, 255};
@ -169,13 +169,22 @@ public OnMapStart()
PrecacheSound(SOUND_BOOM, true);
PrecacheSound(SOUND_FREEZE, true);
if (GuessSDKVersion() == SOURCE_SDK_LEFT4DEAD2)
{
g_BeamSprite = PrecacheModel("materials/sprites/laserbeam.vmt");
g_HaloSprite = PrecacheModel("materials/sprites/glow01.vmt");
}
else
{
g_BeamSprite = PrecacheModel("materials/sprites/laser.vmt");
g_BeamSprite2 = PrecacheModel("sprites/bluelight1.vmt");
g_HaloSprite = PrecacheModel("materials/sprites/halo01.vmt");
g_BeamSprite2 = PrecacheModel("sprites/bluelight1.vmt");
g_GlowSprite = PrecacheModel("sprites/blueglow2.vmt");
g_ExplosionSprite = PrecacheModel("sprites/sprite_fire01.vmt");
}
}
public OnMapEnd()
{
KillAllBeacons( );

View File

@ -133,9 +133,12 @@ public Action:Timer_FireBomb(Handle:timer, any:value)
return Plugin_Continue;
}
else
{
if (g_ExplosionSprite > -1)
{
TE_SetupExplosion(vec, g_ExplosionSprite, 0.1, 1, 0, GetConVarInt(g_Cvar_FireBombRadius), 5000);
TE_SendToAll();
}
GetClientAbsOrigin(client, vec);
vec[2] += 10;

View File

@ -186,7 +186,15 @@ public Action:Timer_Freeze(Handle:timer, any:value)
GetClientAbsOrigin(client, vec);
vec[2] += 10;
if (g_GlowSprite > -1)
{
TE_SetupGlowSprite(vec, g_GlowSprite, 0.95, 1.5, 50);
}
else
{
TE_SetupGlowSprite(vec, g_HaloSprite, 0.95, 1.5, 50);
}
TE_SendToAll();
return Plugin_Continue;
@ -240,9 +248,12 @@ public Action:Timer_FreezeBomb(Handle:timer, any:value)
return Plugin_Continue;
}
else
{
if (g_ExplosionSprite > -1)
{
TE_SetupExplosion(vec, g_ExplosionSprite, 5.0, 1, 0, GetConVarInt(g_Cvar_FreezeBombRadius), 5000);
TE_SendToAll();
}
EmitAmbientSound(SOUND_BOOM, vec, client, SNDLEVEL_RAIDSIREN);
@ -275,7 +286,14 @@ public Action:Timer_FreezeBomb(Handle:timer, any:value)
continue;
}
if (g_BeamSprite2 > -1)
{
TE_SetupBeamPoints(vec, pos, g_BeamSprite2, g_HaloSprite, 0, 1, 0.7, 20.0, 50.0, 1, 1.5, blueColor, 10);
}
else
{
TE_SetupBeamPoints(vec, pos, g_BeamSprite, g_HaloSprite, 0, 1, 0.7, 20.0, 50.0, 1, 1.5, blueColor, 10);
}
TE_SendToAll();
FreezeClient(i, GetConVarInt(g_Cvar_FreezeDuration));

View File

@ -126,9 +126,12 @@ public Action:Timer_TimeBomb(Handle:timer, any:value)
return Plugin_Continue;
}
else
{
if (g_ExplosionSprite > -1)
{
TE_SetupExplosion(vec, g_ExplosionSprite, 5.0, 1, 0, GetConVarInt(g_Cvar_TimeBombRadius), 5000);
TE_SendToAll();
}
EmitAmbientSound(SOUND_BOOM, vec, client, SNDLEVEL_RAIDSIREN);
@ -166,8 +169,12 @@ public Action:Timer_TimeBomb(Handle:timer, any:value)
damage = RoundToFloor(damage * ((GetConVarFloat(g_Cvar_TimeBombRadius) - distance) / GetConVarFloat(g_Cvar_TimeBombRadius)));
SlapPlayer(i, damage, false);
if (g_ExplosionSprite > -1)
{
TE_SetupExplosion(pos, g_ExplosionSprite, 0.05, 1, 0, 1, 1);
TE_SendToAll();
}
/* ToDo
new Float:dir[3];