From: terencehill Date: Mon, 28 Jan 2019 17:48:32 +0000 (+0100) Subject: Fix indentation of all the if if else I could find out and add explicit brackets... X-Git-Tag: xonotic-v0.8.5~1632 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=79c07d6f162c78d9a59a873f66a27a387d5722d7;p=xonotic%2Fxonotic-data.pk3dir.git Fix indentation of all the if if else I could find out and add explicit brackets for clarity sake --- diff --git a/qcsrc/common/gamemodes/gamemode/clanarena/sv_clanarena.qc b/qcsrc/common/gamemodes/gamemode/clanarena/sv_clanarena.qc index 163b996c3..73bb3cfe4 100644 --- a/qcsrc/common/gamemodes/gamemode/clanarena/sv_clanarena.qc +++ b/qcsrc/common/gamemodes/gamemode/clanarena/sv_clanarena.qc @@ -252,12 +252,13 @@ entity ca_LastPlayerForTeam(entity this) { entity last_pl = NULL; FOREACH_CLIENT(IS_PLAYER(it) && it != this, { - if (!IS_DEAD(it)) - if (SAME_TEAM(this, it)) - if (!last_pl) - last_pl = it; - else - return NULL; + if (!IS_DEAD(it) && SAME_TEAM(this, it)) + { + if (!last_pl) + last_pl = it; + else + return NULL; + } }); return last_pl; } diff --git a/qcsrc/common/gamemodes/gamemode/ctf/sv_ctf.qc b/qcsrc/common/gamemodes/gamemode/ctf/sv_ctf.qc index 2696a4e87..5e6e97dd3 100644 --- a/qcsrc/common/gamemodes/gamemode/ctf/sv_ctf.qc +++ b/qcsrc/common/gamemodes/gamemode/ctf/sv_ctf.qc @@ -702,10 +702,12 @@ void ctf_Handle_Pickup(entity flag, entity player, int pickuptype) if(flag.team) FOREACH_CLIENT(IS_PLAYER(it) && it != player, { if(CTF_SAMETEAM(flag, it)) - if(SAME_TEAM(player, it)) - Send_Notification(NOTIF_ONE, it, MSG_CHOICE, APP_TEAM_NUM(flag.team, CHOICE_CTF_PICKUP_TEAM), Team_ColorCode(player.team), player.netname); - else - Send_Notification(NOTIF_ONE, it, MSG_CHOICE, ((SAME_TEAM(flag, player)) ? CHOICE_CTF_PICKUP_ENEMY_TEAM : CHOICE_CTF_PICKUP_ENEMY), Team_ColorCode(player.team), player.netname); + { + if(SAME_TEAM(player, it)) + Send_Notification(NOTIF_ONE, it, MSG_CHOICE, APP_TEAM_NUM(flag.team, CHOICE_CTF_PICKUP_TEAM), Team_ColorCode(player.team), player.netname); + else + Send_Notification(NOTIF_ONE, it, MSG_CHOICE, ((SAME_TEAM(flag, player)) ? CHOICE_CTF_PICKUP_ENEMY_TEAM : CHOICE_CTF_PICKUP_ENEMY), Team_ColorCode(player.team), player.netname); + } }); _sound(player, CH_TRIGGER, flag.snd_flag_taken, VOL_BASE, ATTEN_NONE); diff --git a/qcsrc/common/gamemodes/gamemode/domination/sv_domination.qc b/qcsrc/common/gamemodes/gamemode/domination/sv_domination.qc index 78ff64e51..50e16d53e 100644 --- a/qcsrc/common/gamemodes/gamemode/domination/sv_domination.qc +++ b/qcsrc/common/gamemodes/gamemode/domination/sv_domination.qc @@ -69,10 +69,12 @@ void dompoint_captured(entity this) this.enemy = NULL; if (head.noise != "") + { if(this.enemy) _sound(this.enemy, CH_TRIGGER, head.noise, VOL_BASE, ATTEN_NORM); else _sound(this, CH_TRIGGER, head.noise, VOL_BASE, ATTEN_NORM); + } if (head.noise1 != "") play2all(head.noise1); @@ -466,10 +468,7 @@ MUTATOR_HOOKFUNCTION(dom, PlayerSpawn) entity player = M_ARGV(0, entity); if(domination_roundbased) - if(!round_handler_IsRoundStarted()) - player.player_blocked = 1; - else - player.player_blocked = 0; + player.player_blocked = !round_handler_IsRoundStarted(); } MUTATOR_HOOKFUNCTION(dom, ClientConnect) diff --git a/qcsrc/common/gamemodes/gamemode/invasion/sv_invasion.qc b/qcsrc/common/gamemodes/gamemode/invasion/sv_invasion.qc index c9670a150..dc8c8b282 100644 --- a/qcsrc/common/gamemodes/gamemode/invasion/sv_invasion.qc +++ b/qcsrc/common/gamemodes/gamemode/invasion/sv_invasion.qc @@ -334,14 +334,20 @@ bool Invasion_CheckWinner() { if(red_alive > 0) { winner_team = NUM_TEAM_1; } if(blue_alive > 0) - if(winner_team) { winner_team = 0; } - else { winner_team = NUM_TEAM_2; } + { + if(winner_team) { winner_team = 0; } + else { winner_team = NUM_TEAM_2; } + } if(yellow_alive > 0) - if(winner_team) { winner_team = 0; } - else { winner_team = NUM_TEAM_3; } + { + if(winner_team) { winner_team = 0; } + else { winner_team = NUM_TEAM_3; } + } if(pink_alive > 0) - if(winner_team) { winner_team = 0; } - else { winner_team = NUM_TEAM_4; } + { + if(winner_team) { winner_team = 0; } + else { winner_team = NUM_TEAM_4; } + } } else { @@ -429,13 +435,15 @@ MUTATOR_HOOKFUNCTION(inv, MonsterDies) if(teamplay) { inv_monsters_perteam[frag_target.team] -= 1; } if(IS_PLAYER(frag_attacker)) - if(SAME_TEAM(frag_attacker, frag_target)) // in non-teamplay modes, same team = same player, so this works - GameRules_scoring_add(frag_attacker, KILLS, -1); - else { - GameRules_scoring_add(frag_attacker, KILLS, +1); - if(teamplay) - TeamScore_AddToTeam(frag_attacker.team, ST_INV_KILLS, +1); + if(SAME_TEAM(frag_attacker, frag_target)) // in non-teamplay modes, same team = same player, so this works + GameRules_scoring_add(frag_attacker, KILLS, -1); + else + { + GameRules_scoring_add(frag_attacker, KILLS, +1); + if(teamplay) + TeamScore_AddToTeam(frag_attacker.team, ST_INV_KILLS, +1); + } } } } diff --git a/qcsrc/common/gamemodes/gamemode/keyhunt/sv_keyhunt.qc b/qcsrc/common/gamemodes/gamemode/keyhunt/sv_keyhunt.qc index f8456734c..d33696ad3 100644 --- a/qcsrc/common/gamemodes/gamemode/keyhunt/sv_keyhunt.qc +++ b/qcsrc/common/gamemodes/gamemode/keyhunt/sv_keyhunt.qc @@ -686,10 +686,12 @@ LABEL(not_winning) kh_interferemsg_time = 0; FOREACH_CLIENT(IS_PLAYER(it), { if(it.team == kh_interferemsg_team) + { if(it.kh_next) Send_Notification(NOTIF_ONE, it, MSG_CENTER, CENTER_KEYHUNT_MEET); else Send_Notification(NOTIF_ONE, it, MSG_CENTER, CENTER_KEYHUNT_HELP); + } else Send_Notification(NOTIF_ONE, it, MSG_CENTER, APP_TEAM_NUM(kh_interferemsg_team, CENTER_KEYHUNT_INTERFERE)); }); diff --git a/qcsrc/common/gamemodes/gamemode/lms/sv_lms.qc b/qcsrc/common/gamemodes/gamemode/lms/sv_lms.qc index 58582d290..e30d958a1 100644 --- a/qcsrc/common/gamemodes/gamemode/lms/sv_lms.qc +++ b/qcsrc/common/gamemodes/gamemode/lms/sv_lms.qc @@ -225,10 +225,12 @@ void lms_RemovePlayer(entity player) } if (CS(player).killcount != FRAGS_SPECTATOR && player.lms_spectate_warning < 3) + { if (GameRules_scoring_add(player, LMS_RANK, 0) > 0 && player.lms_spectate_warning < 2) Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_LMS_NOLIVES, player.netname); else Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_LMS_FORFEIT, player.netname); + } } MUTATOR_HOOKFUNCTION(lms, ClientDisconnect) diff --git a/qcsrc/common/gamemodes/gamemode/onslaught/sv_onslaught.qc b/qcsrc/common/gamemodes/gamemode/onslaught/sv_onslaught.qc index 854e37e5e..6ac6c7c4b 100644 --- a/qcsrc/common/gamemodes/gamemode/onslaught/sv_onslaught.qc +++ b/qcsrc/common/gamemodes/gamemode/onslaught/sv_onslaught.qc @@ -679,10 +679,11 @@ void ons_ControlPoint_Touch(entity this, entity toucher) int attackable; if(IS_VEHICLE(toucher) && toucher.owner) - if(autocvar_g_onslaught_allow_vehicle_touch) + { + if (!autocvar_g_onslaught_allow_vehicle_touch) + return; toucher = toucher.owner; - else - return; + } if(!IS_PLAYER(toucher)) { return; } if(STAT(FROZEN, toucher)) { return; } @@ -1716,10 +1717,12 @@ MUTATOR_HOOKFUNCTION(ons, PlayerSpawn) for(tmp_entity = ons_worldcplist; tmp_entity; tmp_entity = tmp_entity.ons_worldcpnext) { if(SAME_TEAM(tmp_entity, player)) - if(random_target) - RandomSelection_AddEnt(tmp_entity, 1, 1); - else if(vlen2(tmp_entity.origin - spawn_loc) <= vlen2(closest_target.origin - spawn_loc) || closest_target == NULL) - closest_target = tmp_entity; + { + if(random_target) + RandomSelection_AddEnt(tmp_entity, 1, 1); + else if(vlen2(tmp_entity.origin - spawn_loc) <= vlen2(closest_target.origin - spawn_loc) || closest_target == NULL) + closest_target = tmp_entity; + } } if(random_target) { closest_target = RandomSelection_chosen_ent; } diff --git a/qcsrc/common/gamemodes/gamemode/race/sv_race.qc b/qcsrc/common/gamemodes/gamemode/race/sv_race.qc index 31309f285..66b23f6a6 100644 --- a/qcsrc/common/gamemodes/gamemode/race/sv_race.qc +++ b/qcsrc/common/gamemodes/gamemode/race/sv_race.qc @@ -259,10 +259,12 @@ MUTATOR_HOOKFUNCTION(rc, MakePlayerObserver) entity player = M_ARGV(0, entity); if(g_race_qualifying) - if(GameRules_scoring_add(player, RACE_FASTEST, 0)) - player.frags = FRAGS_LMS_LOSER; - else - player.frags = FRAGS_SPECTATOR; + { + if(GameRules_scoring_add(player, RACE_FASTEST, 0)) + player.frags = FRAGS_LMS_LOSER; + else + player.frags = FRAGS_SPECTATOR; + } race_PreparePlayer(player); player.race_checkpoint = -1; diff --git a/qcsrc/common/mapobjects/models.qc b/qcsrc/common/mapobjects/models.qc index 10c390040..44a13522a 100644 --- a/qcsrc/common/mapobjects/models.qc +++ b/qcsrc/common/mapobjects/models.qc @@ -166,21 +166,24 @@ bool g_clientmodel_genericsendentity(entity this, entity to, int sf) #define G_MODEL_INIT(ent,sol) \ - if(ent.geomtype) if(autocvar_physics_ode && checkextension("DP_PHYSICS_ODE")) set_movetype(ent, MOVETYPE_PHYSICS); \ + if(ent.geomtype && autocvar_physics_ode && checkextension("DP_PHYSICS_ODE")) set_movetype(ent, MOVETYPE_PHYSICS); \ if(!ent.scale) ent.scale = ent.modelscale; \ SetBrushEntityModel(ent); \ ent.use = g_model_setcolormaptoactivator; \ InitializeEntity(ent, g_model_dropbyspawnflags, INITPRIO_DROPTOFLOOR); \ - if(!ent.solid) ent.solid = (sol); else if(ent.solid < 0) ent.solid = SOLID_NOT; + if(!ent.solid) ent.solid = (sol); \ + else if(ent.solid < 0) ent.solid = SOLID_NOT; #define G_CLIENTMODEL_INIT(ent,sol) \ - if(ent.geomtype) if(autocvar_physics_ode && checkextension("DP_PHYSICS_ODE")) set_movetype(ent, MOVETYPE_PHYSICS); \ + if(ent.geomtype && autocvar_physics_ode && checkextension("DP_PHYSICS_ODE")) set_movetype(ent, MOVETYPE_PHYSICS); \ if(!ent.scale) ent.scale = ent.modelscale; \ SetBrushEntityModel(ent); \ ent.use = g_clientmodel_use; \ InitializeEntity(ent, g_clientmodel_dropbyspawnflags, INITPRIO_DROPTOFLOOR); \ - if(!ent.solid) ent.solid = (sol); else if(ent.solid < 0) ent.solid = SOLID_NOT; \ - if(!ent.bgmscriptsustain) ent.bgmscriptsustain = 1; else if(ent.bgmscriptsustain < 0) ent.bgmscriptsustain = 0; \ + if(!ent.solid) ent.solid = (sol); \ + else if(ent.solid < 0) ent.solid = SOLID_NOT; \ + if(!ent.bgmscriptsustain) ent.bgmscriptsustain = 1; \ + else if(ent.bgmscriptsustain < 0) ent.bgmscriptsustain = 0; \ Net_LinkEntity(ent, true, 0, g_clientmodel_genericsendentity); \ ent.default_solid = sol; diff --git a/qcsrc/common/minigames/minigame/bd.qc b/qcsrc/common/minigames/minigame/bd.qc index 91fa9cbda..8ab37af13 100644 --- a/qcsrc/common/minigames/minigame/bd.qc +++ b/qcsrc/common/minigames/minigame/bd.qc @@ -727,11 +727,13 @@ bool bd_save_level(entity minigame) int target_count = 0, boulder_count = 0; entity piece = NULL; while((piece = findentity(piece,owner,minigame))) - if(piece.classname == "minigame_board_piece") - if(piece.bd_tiletype == BD_TILE_BOULDER) - ++boulder_count; - else if(piece.bd_tiletype == BD_TILE_TARGET) - ++target_count; + if(piece.classname == "minigame_board_piece") + { + if(piece.bd_tiletype == BD_TILE_BOULDER) + ++boulder_count; + else if(piece.bd_tiletype == BD_TILE_TARGET) + ++target_count; + } if(boulder_count != target_count) { @@ -1162,10 +1164,12 @@ string bd_turn_to_string(int turnflags) return _("Better luck next time!"); if ( turnflags & BD_TURN_WIN ) + { if(random() > 0.5) return _("Tubular! Press \"Next Level\" to continue!"); else return _("Wicked! Press \"Next Level\" to continue!"); + } if( turnflags & BD_TURN_EDIT ) return _("Press the space bar to change your currently selected tile"); diff --git a/qcsrc/common/minigames/minigame/ps.qc b/qcsrc/common/minigames/minigame/ps.qc index b5b900b8a..6850bd834 100644 --- a/qcsrc/common/minigames/minigame/ps.qc +++ b/qcsrc/common/minigames/minigame/ps.qc @@ -39,15 +39,19 @@ bool ps_tile_blacklisted(string tile) int number = minigame_tile_number(tile); int letter = minigame_tile_letter(tile); if(letter < 2) + { if(number < 2) return true; else if(number > PS_NUM_CNT - 3) return true; + } if(letter > PS_LET_CNT - 3) + { if(number < 2) return true; else if(number > PS_NUM_CNT - 3) return true; + } return false; } diff --git a/qcsrc/common/monsters/sv_monsters.qc b/qcsrc/common/monsters/sv_monsters.qc index 004fbf92b..0fd6c94ac 100644 --- a/qcsrc/common/monsters/sv_monsters.qc +++ b/qcsrc/common/monsters/sv_monsters.qc @@ -803,10 +803,12 @@ void Monster_Move(entity this, float runspeed, float walkspeed, float stpspeed) if(time > this.pain_finished && time > this.anim_finished) // TODO: use anim_finished instead!? if(!this.state) - if(vdist(this.velocity, >, 10)) - setanim(this, ((do_run) ? this.anim_run : this.anim_walk), true, false, false); - else - setanim(this, this.anim_idle, true, false, false); + { + if(vdist(this.velocity, >, 10)) + setanim(this, ((do_run) ? this.anim_run : this.anim_walk), true, false, false); + else + setanim(this, this.anim_idle, true, false, false); + } } else { @@ -1112,10 +1114,12 @@ void Monster_Move_2D(entity this, float mspeed, bool allow_jumpoff) movelib_move_simple_gravity(this, v_forward, mspeed, 1); if(time > this.pain_finished && time > this.attack_finished_single[0]) - if(vdist(this.velocity, >, 10)) - setanim(this, this.anim_walk, true, false, false); - else - setanim(this, this.anim_idle, true, false, false); + { + if(vdist(this.velocity, >, 10)) + setanim(this, this.anim_walk, true, false, false); + else + setanim(this, this.anim_idle, true, false, false); + } } void Monster_Anim(entity this) diff --git a/qcsrc/common/mutators/mutator/buffs/sv_buffs.qc b/qcsrc/common/mutators/mutator/buffs/sv_buffs.qc index 95216fe54..73c24576c 100644 --- a/qcsrc/common/mutators/mutator/buffs/sv_buffs.qc +++ b/qcsrc/common/mutators/mutator/buffs/sv_buffs.qc @@ -494,10 +494,12 @@ MUTATOR_HOOKFUNCTION(buffs, Damage_Calculate) if(STAT(BUFFS, frag_attacker) & BUFF_BASH.m_itemid) if(frag_force) - if(frag_attacker == frag_target) - frag_force *= autocvar_g_buffs_bash_force_self; - else - frag_force *= autocvar_g_buffs_bash_force; + { + if(frag_attacker == frag_target) + frag_force *= autocvar_g_buffs_bash_force_self; + else + frag_force *= autocvar_g_buffs_bash_force; + } if(STAT(BUFFS, frag_attacker) & BUFF_DISABILITY.m_itemid) if(frag_target != frag_attacker) diff --git a/qcsrc/common/turrets/sv_turrets.qc b/qcsrc/common/turrets/sv_turrets.qc index 37fb5f0d5..b3ddc61cf 100644 --- a/qcsrc/common/turrets/sv_turrets.qc +++ b/qcsrc/common/turrets/sv_turrets.qc @@ -961,10 +961,11 @@ bool turret_firecheck(entity this) { // To close? if (this.tur_dist_aimpos < this.target_range_min) + { if(turret_validate_target(this, this.tur_impactent, this.target_validate_flags) > 0) return true; // Target of opertunity? - else - return false; + return false; + } } // Try to avoid FF? diff --git a/qcsrc/common/vehicles/sv_vehicles.qc b/qcsrc/common/vehicles/sv_vehicles.qc index be8d468fa..e8dd2faa3 100644 --- a/qcsrc/common/vehicles/sv_vehicles.qc +++ b/qcsrc/common/vehicles/sv_vehicles.qc @@ -643,10 +643,12 @@ void vehicles_painframe(entity this) this.velocity += randomvec() * 30; if(this.vehicle_flags & VHF_DMGROLL) + { if(this.vehicle_flags & VHF_DMGHEADROLL) this.tur_head.angles += randomvec(); else this.angles += randomvec(); + } } } @@ -730,11 +732,12 @@ void vehicles_damage(entity this, entity inflictor, entity attacker, float damag if(GetResourceAmount(this, RESOURCE_HEALTH) <= 0) { if(this.owner) + { if(this.vehicle_flags & VHF_DEATHEJECT) vehicles_exit(this, VHEF_EJECT); else vehicles_exit(this, VHEF_RELEASE); - + } antilag_clear(this, this); diff --git a/qcsrc/common/viewloc.qc b/qcsrc/common/viewloc.qc index e1be43af0..55e37c4d9 100644 --- a/qcsrc/common/viewloc.qc +++ b/qcsrc/common/viewloc.qc @@ -77,10 +77,12 @@ void viewloc_SetTags(entity this) this.viewloc = NULL; if(this.viewloc.entnum != this.tag_networkviewloc) - if(this.tag_networkviewloc == 0) - this.viewloc = NULL; - else - this.viewloc = findfloat(NULL, entnum, this.tag_networkviewloc); + { + if(this.tag_networkviewloc == 0) + this.viewloc = NULL; + else + this.viewloc = findfloat(NULL, entnum, this.tag_networkviewloc); + } } vector CursorToWorldCoord(vector mpos) diff --git a/qcsrc/common/weapons/weapon/seeker.qc b/qcsrc/common/weapons/weapon/seeker.qc index 784276ef4..e1fa34ccd 100644 --- a/qcsrc/common/weapons/weapon/seeker.qc +++ b/qcsrc/common/weapons/weapon/seeker.qc @@ -533,10 +533,12 @@ void W_Seeker_Fire_Tag(Weapon thiswep, entity actor, .entity weaponentity) METHOD(Seeker, wr_aim, void(entity thiswep, entity actor, .entity weaponentity)) { if(WEP_CVAR(seeker, type) == 1) + { if(W_Seeker_Tagged_Info(actor, weaponentity, actor.enemy) != NULL) PHYS_INPUT_BUTTON_ATCK(actor) = bot_aim(actor, weaponentity, WEP_CVAR(seeker, missile_speed_max), 0, WEP_CVAR(seeker, missile_lifetime), false); else PHYS_INPUT_BUTTON_ATCK2(actor) = bot_aim(actor, weaponentity, WEP_CVAR(seeker, tag_speed), 0, WEP_CVAR(seeker, tag_lifetime), false); + } else PHYS_INPUT_BUTTON_ATCK(actor) = bot_aim(actor, weaponentity, WEP_CVAR(seeker, tag_speed), 0, WEP_CVAR(seeker, tag_lifetime), false); } diff --git a/qcsrc/common/weapons/weapon/vortex.qc b/qcsrc/common/weapons/weapon/vortex.qc index 2e9a60ab8..81b34e45d 100644 --- a/qcsrc/common/weapons/weapon/vortex.qc +++ b/qcsrc/common/weapons/weapon/vortex.qc @@ -57,10 +57,12 @@ NET_HANDLE(TE_CSQC_VORTEXBEAMPARTICLE, bool isNew) particles_alphamin = particles_alphamax = particles_fade = charge; if(!MUTATOR_CALLHOOK(Particles_VortexBeam, shotorg, endpos)) - if(autocvar_cl_particles_oldvortexbeam && (STAT(ALLOW_OLDVORTEXBEAM) || isdemo())) - WarpZone_TrailParticles_WithMultiplier(NULL, particleeffectnum(EFFECT_VORTEX_BEAM_OLD), shotorg, endpos, 1, PARTICLES_USEALPHA | PARTICLES_USEFADE); - else - WarpZone_TrailParticles_WithMultiplier(NULL, particleeffectnum(EFFECT_VORTEX_BEAM), shotorg, endpos, 1, PARTICLES_USEALPHA | PARTICLES_USEFADE); + { + if(autocvar_cl_particles_oldvortexbeam && (STAT(ALLOW_OLDVORTEXBEAM) || isdemo())) + WarpZone_TrailParticles_WithMultiplier(NULL, particleeffectnum(EFFECT_VORTEX_BEAM_OLD), shotorg, endpos, 1, PARTICLES_USEALPHA | PARTICLES_USEFADE); + else + WarpZone_TrailParticles_WithMultiplier(NULL, particleeffectnum(EFFECT_VORTEX_BEAM), shotorg, endpos, 1, PARTICLES_USEALPHA | PARTICLES_USEFADE); + } return true; } #endif diff --git a/qcsrc/server/g_world.qc b/qcsrc/server/g_world.qc index 522f4f041..4c620c62f 100644 --- a/qcsrc/server/g_world.qc +++ b/qcsrc/server/g_world.qc @@ -615,10 +615,12 @@ void InitGameplayMode() world.fog = string_null; } if(MapInfo_Map_fog != "") + { if(MapInfo_Map_fog == "none") world.fog = string_null; else world.fog = strzone(MapInfo_Map_fog); + } clientstuff = strzone(MapInfo_Map_clientstuff); MapInfo_ClearTemps(); @@ -1644,22 +1646,29 @@ void InitiateOvertime() // ONLY call this if InitiateSuddenDeath returned true float GetWinningCode(float fraglimitreached, float equality) { if(autocvar_g_campaign == 1) + { if(fraglimitreached) return WINNING_YES; else return WINNING_NO; - + } else + { if(equality) + { if(fraglimitreached) return WINNING_STARTSUDDENDEATHOVERTIME; else return WINNING_NEVER; + } else + { if(fraglimitreached) return WINNING_YES; else return WINNING_NO; + } + } } // set the .winning flag for exactly those players with a given field value @@ -1729,19 +1738,20 @@ float WinningCondition_Scores(float limit, float leadlimit) leaderfrags = WinningConditionHelper_topscore; if (limit) - if (leaderfrags == limit - 1) - Send_Notification(NOTIF_ALL, NULL, MSG_ANNCE, ANNCE_REMAINING_FRAG_1); - else if (leaderfrags == limit - 2) - Send_Notification(NOTIF_ALL, NULL, MSG_ANNCE, ANNCE_REMAINING_FRAG_2); - else if (leaderfrags == limit - 3) - Send_Notification(NOTIF_ALL, NULL, MSG_ANNCE, ANNCE_REMAINING_FRAG_3); + { + if (leaderfrags == limit - 1) + Send_Notification(NOTIF_ALL, NULL, MSG_ANNCE, ANNCE_REMAINING_FRAG_1); + else if (leaderfrags == limit - 2) + Send_Notification(NOTIF_ALL, NULL, MSG_ANNCE, ANNCE_REMAINING_FRAG_2); + else if (leaderfrags == limit - 3) + Send_Notification(NOTIF_ALL, NULL, MSG_ANNCE, ANNCE_REMAINING_FRAG_3); + } } } limitreached = false; - if(limit) - if(WinningConditionHelper_topscore >= limit) - limitreached = true; + if (limit && WinningConditionHelper_topscore >= limit) + limitreached = true; if(leadlimit) { float leadlimitreached;