From: Martin Taibr Date: Sun, 6 Oct 2019 16:15:01 +0000 (+0200) Subject: explicit parens around && / || X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=ffccdcd8613c16626f3d641a31d557d71a84304f;p=xonotic%2Fxonotic-data.pk3dir.git explicit parens around && / || --- diff --git a/qcsrc/common/physics/player.qc b/qcsrc/common/physics/player.qc index 5ba6e8268..6fcc53823 100644 --- a/qcsrc/common/physics/player.qc +++ b/qcsrc/common/physics/player.qc @@ -480,7 +480,7 @@ void CheckPlayerJump(entity this) bool playerjump = PlayerJump(this); // required bool air_jump = !playerjump || M_ARGV(2, bool); - bool activate = JETPACK_JUMP(this) && air_jump && PHYS_INPUT_BUTTON_JUMP(this) || PHYS_INPUT_BUTTON_JETPACK(this); + bool activate = (JETPACK_JUMP(this) && air_jump && PHYS_INPUT_BUTTON_JUMP(this)) || PHYS_INPUT_BUTTON_JETPACK(this); bool has_fuel = !PHYS_JETPACK_FUEL(this) || PHYS_AMMO_FUEL(this) || (ITEMS_STAT(this) & IT_UNLIMITED_AMMO); if (!(ITEMS_STAT(this) & ITEM_Jetpack.m_itemid)) { } diff --git a/qcsrc/server/bot/default/havocbot/havocbot.qc b/qcsrc/server/bot/default/havocbot/havocbot.qc index 4e32ce99a..f5279f3fb 100644 --- a/qcsrc/server/bot/default/havocbot/havocbot.qc +++ b/qcsrc/server/bot/default/havocbot/havocbot.qc @@ -273,7 +273,7 @@ void havocbot_bunnyhop(entity this, vector dir) if (!this.goalcurrent || IS_PLAYER(this.goalcurrent)) return; - if((this.aistatus & AI_STATUS_RUNNING) && vdist(this.velocity, <, autocvar_sv_maxspeed * 0.75) + if(((this.aistatus & AI_STATUS_RUNNING) && vdist(this.velocity, <, autocvar_sv_maxspeed * 0.75)) || (this.aistatus & AI_STATUS_DANGER_AHEAD)) { this.aistatus &= ~AI_STATUS_RUNNING; diff --git a/qcsrc/server/cheats.qc b/qcsrc/server/cheats.qc index 1acab9c00..f7146f72b 100644 --- a/qcsrc/server/cheats.qc +++ b/qcsrc/server/cheats.qc @@ -563,7 +563,7 @@ float CheatCommand(entity this, int argc) effectnum = 0; for(entity ent = NULL; (ent = find(ent, classname, "dragbox_box")); ) { - if(e.cnt <= 0 && ent.cnt == 0 || e.cnt == ent.cnt) + if((e.cnt <= 0 && ent.cnt == 0) || e.cnt == ent.cnt) { start = start + ent.origin; ++effectnum; diff --git a/qcsrc/server/client.qc b/qcsrc/server/client.qc index 98616a763..a6191f5a9 100644 --- a/qcsrc/server/client.qc +++ b/qcsrc/server/client.qc @@ -2244,7 +2244,7 @@ void ObserverThink(entity this) if (PHYS_INPUT_BUTTON_JUMP(this) && joinAllowed(this)) { this.flags &= ~FL_JUMPRELEASED; this.flags |= FL_SPAWNING; - } else if(PHYS_INPUT_BUTTON_ATCK(this) && !CS(this).version_mismatch || this.would_spectate) { + } else if((PHYS_INPUT_BUTTON_ATCK(this) && !CS(this).version_mismatch) || this.would_spectate) { this.flags &= ~FL_JUMPRELEASED; if(SpectateNext(this)) { TRANSMUTE(Spectator, this);