]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Apply the same special health value to bots too when the voting phase starts
authorterencehill <piuntn@gmail.com>
Thu, 21 Jan 2021 13:21:44 +0000 (14:21 +0100)
committerterencehill <piuntn@gmail.com>
Thu, 21 Jan 2021 13:21:44 +0000 (14:21 +0100)
qcsrc/server/intermission.qc
qcsrc/server/intermission.qh
qcsrc/server/mapvoting.qc
qcsrc/server/world.qc

index e1fb6f6070503374db00683ed8e8c0ba6e725086..e6766cd590d8f46b0c60f5b7759303843eb1af33 100644 (file)
@@ -450,11 +450,10 @@ void FixIntermissionClient(entity e)
        if(!e.autoscreenshot) // initial call
        {
                e.autoscreenshot = time + 0.8;  // used for autoscreenshot
-               SetResourceExplicit(e, RES_HEALTH, -2342);
-               // first intermission phase; voting phase has positive health (used to decide whether to send SVC_FINALE or not)
+               SetResourceExplicit(e, RES_HEALTH, -2342); // health in the first intermission phase
                for (int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
                {
-                   .entity weaponentity = weaponentities[slot];
+                       .entity weaponentity = weaponentities[slot];
                        if(e.(weaponentity))
                        {
                                e.(weaponentity).effects = EF_NODRAW;
index b0d788ddc1014151b7178828a49071644a047560..667e08914c9d506ec488cae5d90d4e47e7b6d199 100644 (file)
@@ -6,9 +6,9 @@ bool autocvar_samelevel;
 bool autocvar_sv_autoscreenshot;
 string autocvar_sv_intermission_cdtrack;
 
-float intermission_running;
+bool intermission_running;
 float intermission_exittime;
-float alreadychangedlevel;
+bool alreadychangedlevel;
 
 string GetGametype();
 
index 145f3f0251cdcd7fe219d17f5cc88ba7e95dc8df..9242a5b6f4d057aa99e95f356cf80098eb2f6a12 100644 (file)
@@ -591,11 +591,18 @@ void MapVote_Tick()
                return;
 
        int totalvotes = 0;
-       FOREACH_CLIENT(IS_REAL_CLIENT(it), {
+       FOREACH_CLIENT(true, {
+               if(!IS_REAL_CLIENT(it))
+               {
+                       // apply the same special health value to bots too for consistency's sake
+                       if(GetResource(it, RES_HEALTH) != 2342)
+                               SetResourceExplicit(it, RES_HEALTH, 2342);
+                       continue;
+               }
                // hide scoreboard again
                if(GetResource(it, RES_HEALTH) != 2342)
                {
-                       SetResourceExplicit(it, RES_HEALTH, 2342);
+                       SetResourceExplicit(it, RES_HEALTH, 2342); // health in the voting phase
                        CS(it).impulse = 0;
 
                        msg_entity = it;
index 5531d223f72c6b226af5bb20633e5ca911671208..9da86388c1f22936b91de84c88ee9bae265b4b03 100644 (file)
@@ -1265,7 +1265,7 @@ only called if a time or frag limit has expired
 void NextLevel()
 {
        game_stopped = true;
-       intermission_running = 1; // game over
+       intermission_running = true; // game over
 
        // enforce a wait time before allowing changelevel
        if(player_count > 0)