move 0.11s timer absolute minimum stuff

This commit is contained in:
rtldg 2022-12-02 00:46:20 +00:00
parent 1f8461f64b
commit 2dbb211742
2 changed files with 11 additions and 15 deletions

View File

@ -1884,20 +1884,6 @@ public int Native_ChangeClientStyle(Handle handler, int numParams)
return false;
}
public Action Shavit_OnFinishPre(int client, timer_snapshot_t snapshot)
{
float minimum_time = GetStyleSettingFloat(snapshot.bsStyle, snapshot.iTimerTrack == Track_Main ? "minimum_time" : "minimum_time_bonus");
if (snapshot.fCurrentTime < minimum_time)
{
Shavit_PrintToChat(client, "%T", "TimeUnderMinimumTime", client, minimum_time, snapshot.fCurrentTime, snapshot.iTimerTrack == Track_Main ? "minimum_time" : "minimum_time_bonus");
Shavit_StopTimer(client);
return Plugin_Stop;
}
return Plugin_Continue;
}
void CalculateRunTime(timer_snapshot_t s, bool include_end_offset)
{
float ticks = float(s.iFullTicks) + (s.iFractionalTicks / 10000.0);
@ -1943,8 +1929,13 @@ public int Native_FinishMap(Handle handler, int numParams)
CalculateRunTime(gA_Timers[client], true);
if (gA_Timers[client].fCurrentTime <= 0.11)
float minimum_time = GetStyleSettingFloat(gA_Timers[client].bsStyle, gA_Timers[client].iTimerTrack == Track_Main ? "minimum_time" : "minimum_time_bonus");
float current_time = gA_Timers[client].fCurrentTime;
if (current_time <= 0.11 || current_time < minimum_time)
{
Shavit_PrintToChat(client, "%T", (current_time <= 0.11) ? "TimeUnderMinimumTime2" : "TimeUnderMinimumTime", client, (current_time <= 0.11) ? 0.11 : minimum_time, current_time,
gA_Timers[client].iTimerTrack == Track_Main ? "minimum_time" : "minimum_time_bonus");
Shavit_StopTimer(client);
return 0;
}

View File

@ -40,6 +40,11 @@
"#format" "{1:f},{2:f},{3:s}"
"en" "Your time ({2}) was faster than the style's {3} setting ({1}) and did not count."
}
"TimeUnderMinimumTime2"
{
"#format" "{1:f},{2:f}"
"en" "Your time ({2}) was faster or equal to the timer's minimum ({1}) and did not count."
}
// ---------- Menus ---------- //
"StyleMenuTitle"
{