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 279210f..be3fb00 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 5184ee1..a18037d 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 aee3506..6515cc4 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 1f5377b..ebc18a6 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 176b636..9c2c682 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;