l4d2_extrafinaletanks: Do not run on last stand

This commit is contained in:
Jackzie 2021-04-24 13:46:08 -05:00
parent c57b39180c
commit 1369a84a09
No known key found for this signature in database
GPG key ID: 1E834FE36520537A
2 changed files with 8 additions and 3 deletions

View file

@ -9,8 +9,6 @@
#include <sdktools>
#include <left4dhooks>
//#include <sdkhooks>
public ConVar hExtraChance, hExtraCount;
public Plugin myinfo =
@ -50,6 +48,7 @@ static int extraTanksCount = 0;
4 -> all extras spawned, waiting on death
*/
public Action L4D2_OnChangeFinaleStage(int &finaleType, const char[] arg) {
if(hExtraChance.FloatValue == 0.0 || extraTankStage == -1) return Plugin_Continue;
if(finaleType == 8 && extraTankStage <= 1) {
extraTankStage++;
return Plugin_Continue;
@ -74,10 +73,16 @@ public Action Event_TankSpawn(Event event, const char[] name, bool dontBroadcast
}
public Action Event_TankKilled(Event event, const char[] name, bool dontBroadcast) {
if(extraTankStage == 4 && --extraTanksCount == 0) {
L4D2_ChangeFinaleStage(10, "extratankdeath");
L4D2_ForceNextStage();
extraTankStage = 0;
}
}
public void OnMapStart() {
char map[32];
GetCurrentMap(map, sizeof(map));
extraTankStage = StrEqual(map, "c14m2_lighthouse") ? -1 : 0;
extraTanksCount = 0;
}
#if defined DEBUG
public Action Timer_ShowFinale(Handle h) {