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 10bab67..6f257a9 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 b282f25..ee847bc 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;