63 lines
No EOL
1.5 KiB
C++
63 lines
No EOL
1.5 KiB
C++
/*
|
|
* Copyright (c) 2016-2022 Vera Visions LLC.
|
|
*
|
|
* Permission to use, copy, modify, and distribute this software for any
|
|
* purpose with or without fee is hereby granted, provided that the above
|
|
* copyright notice and this permission notice appear in all copies.
|
|
*
|
|
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
* WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER
|
|
* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
|
|
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
*/
|
|
|
|
bool
|
|
Util_IsPaused(void)
|
|
{
|
|
#ifdef CLIENT
|
|
return serverkeyfloat(SERVERKEY_PAUSESTATE) == 1 ? true : false;
|
|
#else
|
|
return false;
|
|
#endif
|
|
}
|
|
|
|
void
|
|
Util_Destroy(void)
|
|
{
|
|
remove(self);
|
|
}
|
|
|
|
string
|
|
Util_TimeToString(float fTime)
|
|
{
|
|
fTime = rint(fTime);
|
|
|
|
switch (fTime) {
|
|
case 0: return "less than one";
|
|
case 1: return "one";
|
|
case 2: return "two";
|
|
case 3: return "three";
|
|
case 4: return "four";
|
|
case 5: return "five";
|
|
case 6: return "six";
|
|
case 7: return "seven";
|
|
case 8: return "eight";
|
|
case 9: return "nine";
|
|
case 10: return "ten";
|
|
default: return "over ten";
|
|
}
|
|
}
|
|
|
|
/* returns whether or not the mode we're playing is a team game */
|
|
int
|
|
Util_IsTeamplay(void)
|
|
{
|
|
#ifdef SERVER
|
|
return g_grMode.IsTeamplay();
|
|
#else
|
|
return (serverkeyfloat("teams") > 0) ? TRUE : FALSE;
|
|
#endif
|
|
} |