Skip to content

Commit 519c9dc

Browse files
authored
Update l4d2_tankrage.sp
current check sometimes returns a null nav area example: c1m1_hotel, teleport to the position "300 5683 2893" the current flow displayed by the plugin outputs "14%" because the "flow" variable is 0, because no nav (pNavArea) was found using "L4D_GetLastKnownArea" is more accurate since it outputs the same value as the "current_flow_distance" game command
1 parent f99907d commit 519c9dc

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

addons/sourcemod/scripting/l4d2_tankrage.sp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,7 @@ float GetMaxSurvivorCompletion()
176176
Address pNavArea;
177177
for (int i = 1; i <= MaxClients; i++) {
178178
if (IsClientInGame(i) && GetClientTeam(i) == 2 && IsPlayerAlive(i)) {
179-
GetClientAbsOrigin(i, origin);
180-
pNavArea = L4D2Direct_GetTerrorNavArea(origin);
179+
pNavArea = L4D_GetLastKnownArea(i);
181180
if (pNavArea != Address_Null) {
182181
tmp_flow = L4D2Direct_GetTerrorNavAreaFlow(pNavArea);
183182
flow = (flow > tmp_flow) ? flow : tmp_flow;
@@ -226,4 +225,4 @@ stock void LoadTranslation(const char[] translation)
226225
SetFailState("Missing translation file %s.txt", translation);
227226

228227
LoadTranslations(translation);
229-
}
228+
}

0 commit comments

Comments
 (0)