From: terencehill Date: Fri, 15 Jun 2018 22:41:22 +0000 (+0200) Subject: Reduce indentation of some code inside of ons_GeneratorThink X-Git-Tag: xonotic-v0.8.5~2042 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=5ebcf89063314ef863e5458d75b920d2d337ffb5;p=xonotic%2Fxonotic-data.pk3dir.git Reduce indentation of some code inside of ons_GeneratorThink --- diff --git a/qcsrc/common/gamemodes/gamemode/onslaught/sv_onslaught.qc b/qcsrc/common/gamemodes/gamemode/onslaught/sv_onslaught.qc index c4f4d32c4..3ae51dcd1 100644 --- a/qcsrc/common/gamemodes/gamemode/onslaught/sv_onslaught.qc +++ b/qcsrc/common/gamemodes/gamemode/onslaught/sv_onslaught.qc @@ -949,22 +949,21 @@ void ons_GeneratorDamage(entity this, entity inflictor, entity attacker, float d void ons_GeneratorThink(entity this) { this.nextthink = time + GEN_THINKRATE; - if (!game_stopped) + + if (game_stopped || this.isshielded || time < this.wait) + return; + + this.wait = time + 5; + FOREACH_CLIENT(IS_PLAYER(it) && IS_REAL_CLIENT(it), { - if(!this.isshielded && this.wait < time) + if (SAME_TEAM(it, this)) { - this.wait = time + 5; - FOREACH_CLIENT(IS_PLAYER(it) && IS_REAL_CLIENT(it), { - if(SAME_TEAM(it, this)) - { - Send_Notification(NOTIF_ONE, it, MSG_CENTER, CENTER_ONS_NOTSHIELDED_TEAM); - soundto(MSG_ONE, it, CHAN_AUTO, SND(KH_ALARM), VOL_BASE, ATTEN_NONE); // FIXME: unique sound? - } - else - Send_Notification(NOTIF_ONE, it, MSG_CENTER, APP_TEAM_NUM(this.team, CENTER_ONS_NOTSHIELDED)); - }); + Send_Notification(NOTIF_ONE, it, MSG_CENTER, CENTER_ONS_NOTSHIELDED_TEAM); + soundto(MSG_ONE, it, CHAN_AUTO, SND(KH_ALARM), VOL_BASE, ATTEN_NONE); // FIXME: unique sound? } - } + else + Send_Notification(NOTIF_ONE, it, MSG_CENTER, APP_TEAM_NUM(this.team, CENTER_ONS_NOTSHIELDED)); + }); } void ons_GeneratorReset(entity this)