mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
51 lines
935 B
C++
51 lines
935 B
C++
//=====================================================================================//
|
|
//
|
|
// Purpose:
|
|
//
|
|
//=====================================================================================//
|
|
|
|
#include <core/stdafx.h>
|
|
#include <tier1/strtools.h>
|
|
#include <engine/common.h>
|
|
|
|
/*
|
|
==============================
|
|
COM_ExplainDisconnection
|
|
|
|
==============================
|
|
*/
|
|
void* HCOM_ExplainDisconnection(void* unused, const char* fmt, ...)
|
|
{
|
|
// !TODO: rebuild.
|
|
return nullptr;
|
|
}
|
|
|
|
const char* COM_FormatSeconds(int seconds)
|
|
{
|
|
static char string[64];
|
|
|
|
int hours = 0;
|
|
int minutes = seconds / 60;
|
|
|
|
if (minutes > 0)
|
|
{
|
|
seconds -= (minutes * 60);
|
|
hours = minutes / 60;
|
|
|
|
if (hours > 0)
|
|
{
|
|
minutes -= (hours * 60);
|
|
}
|
|
}
|
|
|
|
if (hours > 0)
|
|
{
|
|
Q_snprintf(string, sizeof(string), "%2i:%02i:%02i", hours, minutes, seconds);
|
|
}
|
|
else
|
|
{
|
|
Q_snprintf(string, sizeof(string), "%02i:%02i", minutes, seconds);
|
|
}
|
|
|
|
return string;
|
|
} |