]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Make some round_handler functions into macros
authorterencehill <piuntn@gmail.com>
Tue, 5 Mar 2013 17:16:39 +0000 (18:16 +0100)
committerterencehill <piuntn@gmail.com>
Tue, 5 Mar 2013 17:16:39 +0000 (18:16 +0100)
qcsrc/server/round_handler.qc
qcsrc/server/round_handler.qh

index 70a19f684fa0df18d6f847bc2a66a007d93b5541..758b3c1e87510683fac9b0af6c8dc16dc1cd5175 100644 (file)
@@ -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;
index d369ff9213a907bde423065a3b4cb66df31f80b6..48803113f86e9f6bf03b37236aa969fc3d97fb14 100644 (file)
@@ -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)
+