]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix some cases of missing parenthesis in bitflag checks
authorMario <mario.mario@y7mail.com>
Tue, 19 May 2020 16:55:30 +0000 (02:55 +1000)
committerMario <mario.mario@y7mail.com>
Tue, 19 May 2020 16:55:30 +0000 (02:55 +1000)
qcsrc/lib/intrusivelist.qh
qcsrc/menu/xonotic/maplist.qc
qcsrc/server/bot/default/havocbot/havocbot.qc
qcsrc/server/bot/default/navigation.qc
qcsrc/server/bot/default/scripting.qc

index 279210fb1808040aae9479d827fc43e5a3135ce4..be3fb00fa88ad72aad651d185bc974a4a518fd8e 100644 (file)
@@ -248,7 +248,7 @@ void ONREMOVE(entity this)
        if (this.il_lists) {
                for (int i = 0; i < IL_MAX; ++i) {
                        IntrusiveList list = il_links[i];
-                       if (this.il_lists & list.il_listmask && IL_CONTAINS(list, this)) {
+                       if ((this.il_lists & list.il_listmask) && IL_CONTAINS(list, this)) {
                                IL_REMOVE(list, this);
                        }
                }
index 5184ee1fd546a0f90ad3838462a57c005b7b4a9e..a18037db63178830a7e85d675a66564cf01a7a47 100644 (file)
@@ -365,11 +365,11 @@ float XonoticMapList_keyDown(entity me, float scan, float ascii, float shift)
                if(MapInfo_FindName_firstResult >= 0)
                        me.setSelected(me, MapInfo_FindName_firstResult);
        }
-       else if(shift & S_CTRL && scan == 'f') // ctrl-f (as in "F"ind)
+       else if((shift & S_CTRL) && scan == 'f') // ctrl-f (as in "F"ind)
        {
                me.parent.setFocus(me.parent, me.stringFilterBox);
        }
-       else if(shift & S_CTRL && scan == 'u') // ctrl-u (remove stringFilter line
+       else if((shift & S_CTRL) && scan == 'u') // ctrl-u (remove stringFilter line
        {
                me.stringFilterBox.setText(me.stringFilterBox, "");
                MapList_StringFilterBox_Change(me.stringFilterBox, me);
index aee35063561fb4c87052831a056c8fd01bd0b54b..6515cc44efad6bdcbb63a6f11c55f16586ed7bab 100644 (file)
@@ -956,7 +956,7 @@ void havocbot_movetogoal(entity this)
                        {
                                if (vlen2(flat_diff) < vlen2(offset))
                                {
-                                       if (this.goalcurrent.wpflags & WAYPOINTFLAG_JUMP && this.goalstack01)
+                                       if ((this.goalcurrent.wpflags & WAYPOINTFLAG_JUMP) && this.goalstack01)
                                        {
                                                // oblique warpzones need a jump otherwise bots gets stuck
                                                PHYS_INPUT_BUTTON_JUMP(this) = true;
index 1f5377bb388b9d86f887931bcdc8f6ca19e67d24..ebc18a6875353a2306ea07c6304d989860b76cac 100644 (file)
@@ -1654,7 +1654,7 @@ int navigation_poptouchedgoals(entity this)
                if(this.lastteleporttime > 0 && TELEPORT_USED(this, this.goalcurrent))
                {
                        if(this.aistatus & AI_STATUS_WAYPOINT_PERSONAL_GOING)
-                       if(this.goalcurrent.wpflags & WAYPOINTFLAG_PERSONAL && this.goalcurrent.owner==this)
+                       if((this.goalcurrent.wpflags & WAYPOINTFLAG_PERSONAL) && this.goalcurrent.owner==this)
                        {
                                this.aistatus &= ~AI_STATUS_WAYPOINT_PERSONAL_GOING;
                                this.aistatus |= AI_STATUS_WAYPOINT_PERSONAL_REACHED;
@@ -1696,7 +1696,7 @@ int navigation_poptouchedgoals(entity this)
                if (tele_ent && TELEPORT_USED(this, tele_ent))
                {
                        if (this.aistatus & AI_STATUS_WAYPOINT_PERSONAL_GOING)
-                       if (tele_ent.wpflags & WAYPOINTFLAG_PERSONAL && tele_ent.owner == this)
+                       if ((tele_ent.wpflags & WAYPOINTFLAG_PERSONAL) && tele_ent.owner == this)
                        {
                                this.aistatus &= ~AI_STATUS_WAYPOINT_PERSONAL_GOING;
                                this.aistatus |= AI_STATUS_WAYPOINT_PERSONAL_REACHED;
@@ -1718,7 +1718,7 @@ int navigation_poptouchedgoals(entity this)
 
        // Loose goal touching check when running
        // check goalstack01 to make sure waypoint isn't the final goal
-       if(this.aistatus & AI_STATUS_RUNNING && this.goalcurrent.classname == "waypoint" && !(this.goalcurrent.wpflags & WAYPOINTFLAG_JUMP)
+       if((this.aistatus & AI_STATUS_RUNNING) && this.goalcurrent.classname == "waypoint" && !(this.goalcurrent.wpflags & WAYPOINTFLAG_JUMP)
                && this.goalstack01 && !wasfreed(this.goalstack01) && vdist(vec2(this.velocity), >=, autocvar_sv_maxspeed))
        {
                vector gco = this.goalcurrent.origin;
@@ -1733,7 +1733,7 @@ int navigation_poptouchedgoals(entity this)
                        {
                                // Detect personal waypoints
                                if(this.aistatus & AI_STATUS_WAYPOINT_PERSONAL_GOING)
-                               if(this.goalcurrent.wpflags & WAYPOINTFLAG_PERSONAL && this.goalcurrent.owner==this)
+                               if((this.goalcurrent.wpflags & WAYPOINTFLAG_PERSONAL) && this.goalcurrent.owner==this)
                                {
                                        this.aistatus &= ~AI_STATUS_WAYPOINT_PERSONAL_GOING;
                                        this.aistatus |= AI_STATUS_WAYPOINT_PERSONAL_REACHED;
@@ -1769,7 +1769,7 @@ int navigation_poptouchedgoals(entity this)
 
                // Detect personal waypoints
                if(this.aistatus & AI_STATUS_WAYPOINT_PERSONAL_GOING)
-               if(this.goalcurrent.wpflags & WAYPOINTFLAG_PERSONAL && this.goalcurrent.owner==this)
+               if((this.goalcurrent.wpflags & WAYPOINTFLAG_PERSONAL) && this.goalcurrent.owner==this)
                {
                        this.aistatus &= ~AI_STATUS_WAYPOINT_PERSONAL_GOING;
                        this.aistatus |= AI_STATUS_WAYPOINT_PERSONAL_REACHED;
index 176b6361de30bb83ca0870475a3b49b00bfab804..9c2c6825db0342164159eef90cd99c0e59f8ca91 100644 (file)
@@ -1211,12 +1211,12 @@ float bot_execute_commands_once(entity this)
 
        // Handle conditions
        if (!(bot_cmd.bot_cmd_type==BOT_CMD_FI||bot_cmd.bot_cmd_type==BOT_CMD_ELSE))
-       if(this.bot_cmd_condition_status & CMD_CONDITION_true && this.bot_cmd_condition_status & CMD_CONDITION_false_BLOCK)
+       if((this.bot_cmd_condition_status & CMD_CONDITION_true) && this.bot_cmd_condition_status & CMD_CONDITION_false_BLOCK)
        {
                bot_command_executed(this, true);
                return -1;
        }
-       else if(this.bot_cmd_condition_status & CMD_CONDITION_false && this.bot_cmd_condition_status & CMD_CONDITION_true_BLOCK)
+       else if((this.bot_cmd_condition_status & CMD_CONDITION_false) && this.bot_cmd_condition_status & CMD_CONDITION_true_BLOCK)
        {
                bot_command_executed(this, true);
                return -1;