Skip to content

Commit

Permalink
修复上次更新产生的错误
Browse files Browse the repository at this point in the history
  • Loading branch information
fantasylidong committed Mar 24, 2024
1 parent f819349 commit 5a73a6b
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 22 deletions.
Binary file modified addons/sourcemod/plugins/extend/l4d_stats.smx
Binary file not shown.
Binary file modified addons/sourcemod/plugins/extend/rpg.smx
Binary file not shown.
Binary file modified addons/sourcemod/plugins/funcommands.smx
Binary file not shown.
30 changes: 10 additions & 20 deletions addons/sourcemod/scripting/extend/l4d_stats.sp
Original file line number Diff line number Diff line change
Expand Up @@ -9734,7 +9734,7 @@ public CheckSurvivorsWin()

CampaignOver = true;
//StatsPrintToChatTeam(TEAM_SURVIVORS, "\x03CampaignOver值没问题!");
StopMapTiming();
if(!StopMapTiming())return;
CurrentGamemodeID = GetCurrentGamemodeID();
// Return if gamemode is Scavenge or Survival
if (CurrentGamemodeID == GAMEMODE_SCAVENGE ||
Expand All @@ -9749,17 +9749,6 @@ public CheckSurvivorsWin()
decl String:UpdatePoints[32], String:UpdatePointsPenalty[32];
new ClientTeam, bool:NegativeScore = GetConVarBool(cvar_EnableNegativeScore);

if (!MapTimingEnabled() || MapTimingStartTime <= 0.0)
{
return;
}
new Float:TotalTime = GetEngineTime() - MapTimingStartTime;
if(TotalTime < 30.0)
{
StatsPrintToChatAll("记录时间小于30s,数据应该不对,没有分数奖励!(PS: 30s能完成的图算啥图)");
return;
}

switch (CurrentGamemodeID)
{
case GAMEMODE_VERSUS:
Expand Down Expand Up @@ -11147,11 +11136,11 @@ GetCurrentDifficulty()
else return 0;
}

public StopMapTiming()
public bool StopMapTiming()
{
if (!MapTimingEnabled() || MapTimingStartTime <= 0.0 || StatsDisabled())
{
return;
return false;
}
if(g_brpgAvailable && !L4D_RPG_GetGlobalValue(INDEX_VALID))
{
Expand All @@ -11161,7 +11150,7 @@ public StopMapTiming()
}
MapTimingStartTime = -1.0;
MapTimingBlocked = true;
return;
return false;
}
if(!IsNormalMode() && !IsThisRoundValid())
{
Expand All @@ -11171,7 +11160,7 @@ public StopMapTiming()
}
MapTimingStartTime = -1.0;
MapTimingBlocked = true;
return;
return false;
}
int mode = 0;
if(IsAnne())
Expand All @@ -11196,14 +11185,14 @@ public StopMapTiming()
StatsPrintToChatAll("启用了多人运动模式,不记录这张地图游戏时间!");
MapTimingStartTime = -1.0;
MapTimingBlocked = true;
return;
return false;
}

new Float:TotalTime = GetEngineTime() - MapTimingStartTime;
if(TotalTime < 30.0)
{
StatsPrintToChatAll("记录时间小于30s,数据应该不对,没有分数奖励!(PS: 30s能完成的图算啥图)");
return;
return false;
}

MapTimingStartTime = -1.0;
Expand Down Expand Up @@ -11242,8 +11231,8 @@ public StopMapTiming()
}

// Game ended because all of the infected team left the server... don't record the time!
if (InfectedCounter <= 0)
return;
//if (InfectedCounter <= 0)
//return;

new GameDifficulty = GetCurrentDifficulty();
if(mode > 0)
Expand Down Expand Up @@ -11291,6 +11280,7 @@ public StopMapTiming()
}

ClearTrie(MapTimingSurvivors);
return true;
}

GetThisModeBestTime(int UseBuy=0)
Expand Down
5 changes: 4 additions & 1 deletion addons/sourcemod/scripting/extend/rpg.sp
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,10 @@ public void OnClientPostAdminCheck(int client)
{
if(!IsValidClient(client) || IsFakeClient(client))
return;
player[client].ClientFirstBuy = false;
if(IsStart)
player[client].ClientFirstBuy = false;
else
player[client].ClientFirstBuy = true;
player[client].ClientRecoil = 1;
player[client].CanBuy=true;
player[client].ClientPoints = 500;
Expand Down
3 changes: 2 additions & 1 deletion addons/sourcemod/scripting/sourcemod/funcommands/noclip.sp
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,8 @@ public int MenuHandler_NoClip(Menu menu, MenuAction action, int param1, int para

PerformNoClip(param1, target);
ShowActivity2(param1, "[SM] ", "%t", "Toggled noclip on target", "_s", name);
if(g_bRPG)L4D_RPG_SetGlobalValue(INDEX_VALID, false);
if(g_bRPG && GetUserAdmin(target).ImmunityLevel < 100 )
L4D_RPG_SetGlobalValue(INDEX_VALID, false);
}

/* Re-draw the menu if they're still valid */
Expand Down

0 comments on commit 5a73a6b

Please sign in to comment.