General: Move some code around.
Move the 'human' code back to its original location, and call the infection function instead when they should be infected, instead of doing it forcefully. That caused issues whenever there was a situation of a warmup round ect. blocking infections.
This commit is contained in:
parent
c8f7964a0c
commit
811c5ccb72
|
@ -278,6 +278,13 @@ InfectOnClientSpawn(client)
|
||||||
// Disable zombie flag on client.
|
// Disable zombie flag on client.
|
||||||
g_bZombie[client] = false;
|
g_bZombie[client] = false;
|
||||||
|
|
||||||
|
// Check if client is spawning on the terrorists team.
|
||||||
|
if (ZRIsClientOnTeam(client, CS_TEAM_T) && InfectHasZombieSpawned())
|
||||||
|
{
|
||||||
|
CS_SwitchTeam(client, CS_TEAM_CT);
|
||||||
|
CS_RespawnPlayer(client);
|
||||||
|
}
|
||||||
|
|
||||||
InfectUnglitchKevlar(client);
|
InfectUnglitchKevlar(client);
|
||||||
|
|
||||||
// Forward event to modules.
|
// Forward event to modules.
|
||||||
|
|
|
@ -130,29 +130,10 @@ ZSpawnOnClientSpawn(client)
|
||||||
|
|
||||||
switch(condition)
|
switch(condition)
|
||||||
{
|
{
|
||||||
case ZSpawn_Human, ZSpawn_Block:
|
|
||||||
{
|
|
||||||
// Disable zombie flag on client.
|
|
||||||
g_bZombie[client] = false;
|
|
||||||
|
|
||||||
// Check if client is spawning on the terrorists team.
|
|
||||||
if (ZRIsClientOnTeam(client, CS_TEAM_T))
|
|
||||||
{
|
|
||||||
CS_SwitchTeam(client, CS_TEAM_CT);
|
|
||||||
CS_RespawnPlayer(client);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
case ZSpawn_Zombie:
|
case ZSpawn_Zombie:
|
||||||
{
|
{
|
||||||
// Enable zombie flag on client.
|
// Our client should be infected.
|
||||||
g_bZombie[client] = true;
|
InfectHumanToZombie(client);
|
||||||
|
|
||||||
// Check if client is spawning on the counter-terrorists team.
|
|
||||||
if (ZRIsClientOnTeam(client, CS_TEAM_CT))
|
|
||||||
{
|
|
||||||
CS_SwitchTeam(client, CS_TEAM_T);
|
|
||||||
CS_RespawnPlayer(client);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -559,15 +540,15 @@ ZSpawnCondition:GetZSpawnCondition()
|
||||||
new zspawntimelimitzombie = GetConVarInt(g_hCvarsList[CVAR_ZSPAWN_TIMELIMIT_ZOMBIE]);
|
new zspawntimelimitzombie = GetConVarInt(g_hCvarsList[CVAR_ZSPAWN_TIMELIMIT_ZOMBIE]);
|
||||||
switch(zspawntimelimitzombie)
|
switch(zspawntimelimitzombie)
|
||||||
{
|
{
|
||||||
case -1:
|
case ZSpawn_Block:
|
||||||
{
|
{
|
||||||
condition = ZSpawn_Block;
|
condition = ZSpawn_Block;
|
||||||
}
|
}
|
||||||
case 0:
|
case ZSpawn_Human:
|
||||||
{
|
{
|
||||||
condition = ZSpawn_Human;
|
condition = ZSpawn_Human;
|
||||||
}
|
}
|
||||||
case 1:
|
case ZSpawn_Zombie:
|
||||||
{
|
{
|
||||||
condition = ZSpawn_Zombie;
|
condition = ZSpawn_Zombie;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user