diff --git a/addons/sourcemod/plugins/optional/survivor_mvp.smx b/addons/sourcemod/plugins/optional/survivor_mvp.smx index 5debb4fe7..30415a1ac 100644 Binary files a/addons/sourcemod/plugins/optional/survivor_mvp.smx and b/addons/sourcemod/plugins/optional/survivor_mvp.smx differ diff --git a/addons/sourcemod/scripting/survivor_mvp.sp b/addons/sourcemod/scripting/survivor_mvp.sp index 57e0aff71..ce4d5a277 100644 --- a/addons/sourcemod/scripting/survivor_mvp.sp +++ b/addons/sourcemod/scripting/survivor_mvp.sp @@ -85,7 +85,7 @@ public Plugin:myinfo = name = "Survivor MVP notification", author = "Tabun, Artifacial", description = "Shows MVP for survivor team at end of round", - version = "0.3.2", + version = "0.3.3", url = "https://github.com/alexberriman/l4d2_survivor_mvp" }; @@ -96,13 +96,12 @@ new Handle: hCountTankDamage = INVALID_HANDLE; // whether we're new Handle: hCountWitchDamage = INVALID_HANDLE; // whether we're tracking witch damage for MVP-selection new Handle: hTrackFF = INVALID_HANDLE; // whether we're tracking friendly-fire damage (separate stat) new Handle: hBrevityFlags = INVALID_HANDLE; // how verbose/brief the output should be: -new Handle: hRUPActive = INVALID_HANDLE; // whether the ready up mod is active new bool: bCountTankDamage; new bool: bCountWitchDamage; new bool: bTrackFF; new iBrevityFlags; -new bool: bRUPActive; +new bool: bRUPLive; new String: sClientName[MAXPLAYERS + 1][64]; // which name is connected to the clientId? @@ -276,17 +275,6 @@ public OnPluginStart() if (!(iBrevityFlags & BREV_FF)) { bTrackFF = true; } // force tracking on if we're showing FF - // RUP? - hRUPActive = FindConVar("l4d_ready_enabled"); - if (hRUPActive != INVALID_HANDLE) - { - // hook changes for this, and set state appropriately - bRUPActive = GetConVarBool(hRUPActive); - HookConVarChange(hRUPActive, ConVarChange_RUPActive); - } else { - // not loaded - bRUPActive = false; - } bPlayerLeftStartArea = false; // Commands @@ -297,12 +285,10 @@ public OnPluginStart() RegConsoleCmd("say_team", Say_Cmd); } -/* -public OnPluginEnd() +public OnRoundIsLive() { -// nothing + bRUPLive = true; } -*/ public OnClientPutInServer(client) { @@ -362,10 +348,6 @@ public ConVarChange_BrevityFlags(Handle:cvar, const String:oldValue[], const Str } // force tracking on if we're showing FF } -public ConVarChange_RUPActive(Handle:cvar, const String:oldValue[], const String:newValue[]) { - bRUPActive = StringToInt(newValue) != 0; -} - /* * map load / round start/end * ========================== @@ -434,6 +416,7 @@ public void ScavRoundStart(Handle:event, const String:name[], bool:dontBroadcast public RoundStart_Event(Handle:event, const String:name[], bool:dontBroadcast) { bPlayerLeftStartArea = false; + bRUPLive = false; if (!bInRound) { @@ -523,6 +506,7 @@ public RoundEnd_Event(Handle:event, const String:name[], bool:dontBroadcast) } } + bRUPLive = false; tankSpawned = false; } @@ -908,10 +892,10 @@ public PlayerHurt_Event(Handle:event, const String:name[], bool:dontBroadcast) } // Otherwise if friendly fire - else if (GetClientTeam(attacker) == TEAM_SURVIVOR && GetClientTeam(victim) == TEAM_SURVIVOR && bTrackFF) // survivor on survivor action == FF + else if (GetClientTeam(attacker) == TEAM_SURVIVOR && GetClientTeam(victim) == TEAM_SURVIVOR && bTrackFF && !L4D_IsPlayerIncapacitated(victim)) // survivor on survivor action == FF { - if (!bRUPActive || GetEntityMoveType(victim) != MOVETYPE_NONE || !L4D_IsPlayerIncapacitated(victim) || bPlayerLeftStartArea) { - // but don't record while frozen in readyup / before leaving saferoom / victim is incapacitated + if (bRUPLive || bPlayerLeftStartArea) { + // but don't record before readyup ended or before leaving saferoom if readyup is not loaded. iDidFF[attacker] += damageDone; iTotalFF += damageDone; }