mirror of
https://github.com/shavitush/bhoptimer.git
synced 2025-12-07 10:28:26 +00:00
move 0.11s timer absolute minimum stuff
This commit is contained in:
parent
1f8461f64b
commit
2dbb211742
@ -1884,20 +1884,6 @@ public int Native_ChangeClientStyle(Handle handler, int numParams)
|
|||||||
return false;
|
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)
|
void CalculateRunTime(timer_snapshot_t s, bool include_end_offset)
|
||||||
{
|
{
|
||||||
float ticks = float(s.iFullTicks) + (s.iFractionalTicks / 10000.0);
|
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);
|
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);
|
Shavit_StopTimer(client);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -40,6 +40,11 @@
|
|||||||
"#format" "{1:f},{2:f},{3:s}"
|
"#format" "{1:f},{2:f},{3:s}"
|
||||||
"en" "Your time ({2}) was faster than the style's {3} setting ({1}) and did not count."
|
"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 ---------- //
|
// ---------- Menus ---------- //
|
||||||
"StyleMenuTitle"
|
"StyleMenuTitle"
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user