From: terencehill Date: Tue, 5 Mar 2013 17:16:39 +0000 (+0100) Subject: Make some round_handler functions into macros X-Git-Tag: xonotic-v0.7.0~61^2~30 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=5769b6071623a4d8c7dc752c69be09210d69aac4;p=xonotic%2Fxonotic-data.pk3dir.git Make some round_handler functions into macros --- diff --git a/qcsrc/server/round_handler.qc b/qcsrc/server/round_handler.qc index 70a19f684..758b3c1e8 100644 --- a/qcsrc/server/round_handler.qc +++ b/qcsrc/server/round_handler.qc @@ -92,31 +92,6 @@ void round_handler_Spawn(float() canRoundStart_func, float() canRoundEnd_func, v round_starttime = time + round_handler.count; } -float round_handler_IsActive() -{ - return (round_handler != world); -} - -float round_handler_AwaitingNextRound() -{ - return (round_handler.wait); -} - -float round_handler_CountdownRunning() -{ - return (!round_handler.wait && round_handler.cnt); -} - -float round_handler_IsRoundStarted() -{ - return (!round_handler.wait && !round_handler.cnt); -} - -float round_handler_GetTimeLeft() -{ - return (round_handler.round_endtime - time); -} - void round_handler_Reset(float next_think) { round_handler.wait = FALSE; diff --git a/qcsrc/server/round_handler.qh b/qcsrc/server/round_handler.qh index d369ff921..48803113f 100644 --- a/qcsrc/server/round_handler.qh +++ b/qcsrc/server/round_handler.qh @@ -12,11 +12,12 @@ entity round_handler; void round_handler_Init(float the_delay, float the_count, float the_round_timelimit); void round_handler_Spawn(float() canRoundStart_func, float() canRoundEnd_func, void() roundStart_func); -float round_handler_IsActive(); -float round_handler_AwaitingNextRound(); -float round_handler_CountdownRunning(); -float round_handler_IsRoundStarted(); -float round_handler_GetTimeLeft(); void round_handler_Reset(float next_think); void round_handler_Remove(); +#define round_handler_IsActive() (round_handler != world) +#define round_handler_AwaitingNextRound() (round_handler.wait) +#define round_handler_CountdownRunning() (!round_handler.wait && round_handler.cnt) +#define round_handler_IsRoundStarted() (!round_handler.wait && !round_handler.cnt) +#define round_handler_GetTimeLeft() (round_handler.round_endtime - time) +