Skip to content

Commit 5f553ac

Browse files
authored
Confoglcompmod: Hotfix for tank going out of bounds (#552)
* Confoglcompmod: Hotfix for tank going out of bounds * Confoglcompmod: Small oversight `BS_bExpectTankSpawn` always becomes true whenever `L4D_OnSpawnTank` triggers.
1 parent ee53372 commit 5f553ac

3 files changed

Lines changed: 4 additions & 23 deletions

File tree

-267 Bytes
Binary file not shown.

addons/sourcemod/scripting/confoglcompmod.sp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
#define DEBUG_ALL 0
55

6-
#define PLUGIN_VERSION "2.3.1"
6+
#define PLUGIN_VERSION "2.3.2"
77

88
// Using these macros, you can disable unnecessary modules,
99
// and they will not be included in the plugin at compile time,
@@ -414,7 +414,7 @@ public Action L4D_OnSpawnTank(const float vector[3], const float qangle[3])
414414
public void L4D_OnSpawnTank_Post(int client, const float vecPos[3], const float vecAng[3])
415415
{
416416
//Modules
417-
BS_OnTankSpawnPost_Forward(); //BossSpawning
417+
BS_OnTankSpawnPost_Forward(client); //BossSpawning
418418
}
419419
#endif
420420

addons/sourcemod/scripting/confoglcompmod/BossSpawning.sp

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ static bool
1717
BS_bEnabled = true,
1818
BS_bIsFirstRound = true,
1919
BS_bDeleteWitches = false,
20-
BS_bFinaleStarted = false,
21-
BS_bExpectTankSpawn = false;
20+
BS_bFinaleStarted = false;
2221

2322
static int
2423
BS_iTankCount[ROUND_MAX_COUNT] = {0, ...},
@@ -38,7 +37,6 @@ void BS_OnModuleStart()
3837
BS_bEnabled = BS_hEnabled.BoolValue;
3938
BS_hEnabled.AddChangeHook(BS_ConVarChange);
4039

41-
HookEvent("tank_spawn", BS_TankSpawn);
4240
HookEvent("witch_spawn", BS_WitchSpawn);
4341
HookEvent("round_end", BS_RoundEnd, EventHookMode_PostNoCopy);
4442
HookEvent("finale_start", BS_FinaleStart, EventHookMode_PostNoCopy);
@@ -50,7 +48,6 @@ void BS_OnMapStart()
5048
{
5149
BS_bIsFirstRound = true;
5250
BS_bFinaleStarted = false;
53-
BS_bExpectTankSpawn = false;
5451

5552
for (int i = 0; i < ROUND_MAX_COUNT; i++) {
5653
BS_iTankCount[i] = 0;
@@ -99,14 +96,7 @@ public void BS_WitchSpawn(Event hEvent, const char[] sEventName, bool bDontBroad
9996
}
10097
}
10198

102-
void BS_OnTankSpawnPost_Forward()
103-
{
104-
if (BS_bEnabled && IsPluginEnabled()) {
105-
BS_bExpectTankSpawn = true;
106-
}
107-
}
108-
109-
public void BS_TankSpawn(Event hEvent, const char[] sEventName, bool bDontBroadcast)
99+
void BS_OnTankSpawnPost_Forward(int iTankClient)
110100
{
111101
if (!BS_bEnabled || !IsPluginEnabled()) {
112102
return;
@@ -117,20 +107,11 @@ public void BS_TankSpawn(Event hEvent, const char[] sEventName, bool bDontBroadc
117107
return;
118108
}
119109

120-
// Stop if this isn't the first tank_spawn for this tank
121-
if (!BS_bExpectTankSpawn) {
122-
return;
123-
}
124-
125-
BS_bExpectTankSpawn = false;
126-
127110
// Don't track tank spawns on c5m5 or tank can spawn behind other team.
128111
if (strcmp(BS_sMap, "c5m5_bridge") == 0) {
129112
return;
130113
}
131114

132-
int iTankClient = GetClientOfUserId(hEvent.GetInt("userid"));
133-
134115
if (GetMapValueInt("tank_z_fix")) {
135116
FixZDistance(iTankClient); // fix stuck tank spawns, ex c1m1
136117
}

0 commit comments

Comments
 (0)