From 92d8ff71c2c9f1852b3d4d76546f29877d8f621e Mon Sep 17 00:00:00 2001 From: terencehill Date: Thu, 21 Jan 2021 14:21:44 +0100 Subject: [PATCH] Apply the same special health value to bots too when the voting phase starts --- qcsrc/server/intermission.qc | 5 ++--- qcsrc/server/intermission.qh | 4 ++-- qcsrc/server/mapvoting.qc | 11 +++++++++-- qcsrc/server/world.qc | 2 +- 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/qcsrc/server/intermission.qc b/qcsrc/server/intermission.qc index e1fb6f607..e6766cd59 100644 --- a/qcsrc/server/intermission.qc +++ b/qcsrc/server/intermission.qc @@ -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; diff --git a/qcsrc/server/intermission.qh b/qcsrc/server/intermission.qh index b0d788ddc..667e08914 100644 --- a/qcsrc/server/intermission.qh +++ b/qcsrc/server/intermission.qh @@ -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(); diff --git a/qcsrc/server/mapvoting.qc b/qcsrc/server/mapvoting.qc index 145f3f025..9242a5b6f 100644 --- a/qcsrc/server/mapvoting.qc +++ b/qcsrc/server/mapvoting.qc @@ -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; diff --git a/qcsrc/server/world.qc b/qcsrc/server/world.qc index 5531d223f..9da86388c 100644 --- a/qcsrc/server/world.qc +++ b/qcsrc/server/world.qc @@ -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) -- 2.39.2