mirror of
https://github.com/shavitush/bhoptimer.git
synced 2025-12-07 10:28:26 +00:00
fix SSJ printed wrong and (#129)
This commit is contained in:
parent
95c850f88a
commit
bae6e18322
@ -253,13 +253,20 @@ stock bool IsValidClient(int client, bool bAlive = false) // when bAlive is fals
|
||||
// time formatting!
|
||||
stock void FormatSeconds(float time, char[] newtime, int newtimesize, bool precise = true)
|
||||
{
|
||||
int iRounded = RoundToFloor(time);
|
||||
float fSeconds = (iRounded % 60) + time - iRounded;
|
||||
float fTempTime = time;
|
||||
|
||||
if(fTempTime < 0.0)
|
||||
{
|
||||
fTempTime = -fTempTime;
|
||||
}
|
||||
|
||||
int iRounded = RoundToFloor(fTempTime);
|
||||
float fSeconds = (iRounded % 60) + fTempTime - iRounded;
|
||||
|
||||
char[] sSeconds = new char[8];
|
||||
FormatEx(sSeconds, 8, precise? "%.03f":"%.01f", fSeconds);
|
||||
|
||||
if(time < 60.0)
|
||||
if(fTempTime < 60.0)
|
||||
{
|
||||
strcopy(newtime, newtimesize, sSeconds);
|
||||
}
|
||||
@ -268,9 +275,9 @@ stock void FormatSeconds(float time, char[] newtime, int newtimesize, bool preci
|
||||
{
|
||||
int iMinutes = (iRounded / 60);
|
||||
|
||||
if(time < 3600.0)
|
||||
if(fTempTime < 3600.0)
|
||||
{
|
||||
FormatEx(newtime, newtimesize, "%d:%s%s", iMinutes, (fSeconds < 10)? "0":"", sSeconds);
|
||||
FormatEx(newtime, newtimesize, "%s%d:%s%s", (time < 0.0)? "-":"", iMinutes, (fSeconds < 10)? "0":"", sSeconds);
|
||||
}
|
||||
|
||||
else
|
||||
@ -278,7 +285,7 @@ stock void FormatSeconds(float time, char[] newtime, int newtimesize, bool preci
|
||||
iMinutes %= 60;
|
||||
int iHours = (iRounded / 3600);
|
||||
|
||||
FormatEx(newtime, newtimesize, "%d:%s%d:%s%s", iHours, (iMinutes < 10)? "0":"", iMinutes, (fSeconds < 10)? "0":"", sSeconds);
|
||||
FormatEx(newtime, newtimesize, "-%d:%s%d:%s%s", (time < 0.0)? "-":"", iHours, (iMinutes < 10)? "0":"", iMinutes, (fSeconds < 10)? "0":"", sSeconds);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1217,21 +1217,18 @@ public void Player_Jump(Event event, const char[] name, bool dB)
|
||||
|
||||
for(int i = 1; i <= MaxClients; i++)
|
||||
{
|
||||
if(i == client)
|
||||
if(i == client || !IsValidClient(i) || !IsClientObserver(i) || IsFakeClient(i))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if(IsValidClient(i) && IsClientObserver(i))
|
||||
{
|
||||
int iObserverMode = GetEntProp(i, Prop_Send, "m_iObserverMode");
|
||||
int iObserverMode = GetEntProp(i, Prop_Send, "m_iObserverMode");
|
||||
|
||||
if(iObserverMode >= 3 && iObserverMode <= 5)
|
||||
if(iObserverMode >= 3 && iObserverMode <= 5)
|
||||
{
|
||||
if(GetEntPropEnt(i, Prop_Send, "m_hObserverTarget") == client)
|
||||
{
|
||||
if(GetEntPropEnt(i, Prop_Send, "m_hObserverTarget") == client)
|
||||
{
|
||||
PrintSSJ(client, i, gain);
|
||||
}
|
||||
PrintSSJ(i, client, gain);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user