]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Small cleanups
authorterencehill <piuntn@gmail.com>
Thu, 22 Aug 2019 00:56:40 +0000 (02:56 +0200)
committerterencehill <piuntn@gmail.com>
Thu, 22 Aug 2019 00:56:40 +0000 (02:56 +0200)
qcsrc/server/bot/default/havocbot/havocbot.qc
qcsrc/server/bot/default/waypoints.qc

index 10bab67f045de8bb8428d5116f4a265ff008dbc9..6f257a9ca3ccf7b183d7122bec5af0b79bf7fd42 100644 (file)
@@ -441,10 +441,7 @@ void havocbot_movetogoal(entity this)
        CS(this).movement = '0 0 0';
        maxspeed = autocvar_sv_maxspeed;
 
-       if (this.goalcurrent.wpflags & WAYPOINTFLAG_CROUCH)
-               PHYS_INPUT_BUTTON_CROUCH(this) = true;
-       else
-               PHYS_INPUT_BUTTON_CROUCH(this) = false;
+       PHYS_INPUT_BUTTON_CROUCH(this) = boolean(this.goalcurrent.wpflags & WAYPOINTFLAG_CROUCH);
 
        PHYS_INPUT_BUTTON_JETPACK(this) = false;
        // Jetpack navigation
index b282f258e0f89dd13e75c41b1cf8b8b98a7f3dcc..ee847bc6de4dac58a5017a8b2ec1a1f4d28c788f 100644 (file)
@@ -1024,7 +1024,7 @@ float waypoint_gettravelcost(vector from, vector to, entity from_ent, entity to_
        if(height > jumpheight_vec.z && autocvar_sv_gravity > 0)
        {
                float height_cost; // fall cost
-               if (boolean(from_ent.wpflags & WAYPOINTFLAG_JUMP))
+               if (from_ent.wpflags & WAYPOINTFLAG_JUMP)
                        height_cost = jumpheight_time + sqrt((height + jumpheight_vec.z) / (autocvar_sv_gravity / 2));
                else
                        height_cost = sqrt(height / (autocvar_sv_gravity / 2));
@@ -1839,8 +1839,7 @@ float waypoint_loadall()
                if (!s)
                        break;
                fl = stof(s);
-               if (fl & WAYPOINTFLAG_NORELINK__DEPRECATED)
-                       fl &= ~WAYPOINTFLAG_NORELINK__DEPRECATED;
+               fl &= ~WAYPOINTFLAG_NORELINK__DEPRECATED;
                waypoint_spawn(m1, m2, fl);
                if (m1 == m2)
                        cwp = cwp + 1;