]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
yeet drjaska/survival-sendflags 1342/head
authordrjaska <drjaska83@gmail.com>
Tue, 3 Sep 2024 11:07:15 +0000 (14:07 +0300)
committerdrjaska <drjaska83@gmail.com>
Tue, 3 Sep 2024 11:07:15 +0000 (14:07 +0300)
qcsrc/common/gamemodes/gamemode/survival/sv_survival.qc
qcsrc/lib/net.qh

index 52abd264eed8ceee22f6b995a3aca937272703f3..9958bd6215d14d5b9152639f420eed3804fae184 100644 (file)
@@ -13,17 +13,6 @@ void SurvivalStatuses_Init();
 
 #define STATUS_SEND_RESET   1
 #define STATUS_SEND_HUNTERS 2
-#define STATUS_SEND_ALL     3
-
-void SurvivalStatuses_Send(int sendflags)
-{
-       // If SendFlags is set to non-0 it is networked
-       //
-       // STATUS_SEND_RESET   or BIT(0) or 1 or 0000 0001 -> set all players as survivors
-       // STATUS_SEND_HUNTERS or BIT(1) or 2 or 0000 0010 -> reveal hunters to hunters or to all if round has ended
-       // STATUS_SEND_ALL     or ^both^ or 3 or 0000 0011 -> both of the above
-       survivalStatuses.SendFlags = sendflags;
-}
 
 bool SurvivalStatuses_SendEntity(entity this, entity dest, float sendflags)
 {
@@ -107,7 +96,7 @@ float Surv_CheckWinner()
                allowed_to_spawn = false;
                game_stopped = true;
                round_handler_Init(5, autocvar_g_survival_warmup, autocvar_g_survival_round_timelimit);
-               SurvivalStatuses_Send(STATUS_SEND_HUNTERS);
+               survivalStatuses.SendFlags = STATUS_SEND_HUNTERS;
                return 1;
        }
 
@@ -165,7 +154,7 @@ float Surv_CheckWinner()
        allowed_to_spawn = false;
        game_stopped = true;
        round_handler_Init(5, autocvar_g_survival_warmup, autocvar_g_survival_round_timelimit);
-       SurvivalStatuses_Send(STATUS_SEND_HUNTERS);
+       survivalStatuses.SendFlags = STATUS_SEND_HUNTERS;
 
        FOREACH_CLIENT(true,
        {
@@ -200,7 +189,7 @@ void Surv_RoundStart()
                total_hunters++;
                it.survival_status = SURV_STATUS_HUNTER;
        });
-       SurvivalStatuses_Send(STATUS_SEND_RESET);
+       survivalStatuses.SendFlags = STATUS_SEND_RESET;
 
        FOREACH_CLIENT(IS_PLAYER(it) && !IS_DEAD(it),
        {
@@ -344,7 +333,7 @@ MUTATOR_HOOKFUNCTION(surv, reset_map_players)
                }
        });
        bot_relinkplayerlist();
-       SurvivalStatuses_Send(STATUS_SEND_RESET);
+       survivalStatuses.SendFlags = STATUS_SEND_RESET;
        return true;
 }
 
index 7c490fd157e477c70d723b3663b77116c2f6f833..af44475ceb0184cbfe4c2d3dca7d045cf90b68df 100644 (file)
@@ -114,6 +114,7 @@ STATIC_INIT(C2S_Protocol_renumber) { FOREACH(C2S_Protocol, true, it.m_id = i); }
 #ifdef SVQC
        const int MSG_ENTITY = 5;
 
+       // If SendFlags is set to non-0 it is networked
        .int SendFlags;
 
        IntrusiveList g_uncustomizables;