]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'martin-t/degotofication' into 'master'
authorMario <mario.mario@y7mail.com>
Sat, 7 Sep 2019 05:21:52 +0000 (05:21 +0000)
committerMario <mario.mario@y7mail.com>
Sat, 7 Sep 2019 05:21:52 +0000 (05:21 +0000)
Remove some gotos

See merge request xonotic/xonotic-data.pk3dir!707

qcsrc/server/bot/default/havocbot/havocbot.qc
qcsrc/server/g_world.qc
xonotic-client.cfg

index 6f257a9ca3ccf7b183d7122bec5af0b79bf7fd42..4e32ce99a0c415927749afa9f89b672f6e2a6c49 100644 (file)
@@ -89,6 +89,9 @@ void havocbot_ai(entity this)
                bot_strategytoken_taken = true;
        }
 
+       if (this.goalcurrent && wasfreed(this.goalcurrent))
+               navigation_clearroute(this);
+
        if(IS_DEAD(this) || STAT(FROZEN, this))
        {
                if (this.goalcurrent)
@@ -267,7 +270,7 @@ void havocbot_bunnyhop(entity this, vector dir)
        if(this.aistatus & AI_STATUS_ATTACKING)
                return;
 
-       if(IS_PLAYER(this.goalcurrent))
+       if (!this.goalcurrent || IS_PLAYER(this.goalcurrent))
                return;
 
        if((this.aistatus & AI_STATUS_RUNNING) && vdist(this.velocity, <, autocvar_sv_maxspeed * 0.75)
@@ -292,8 +295,6 @@ void havocbot_bunnyhop(entity this, vector dir)
                this.bot_timelastseengoal = 0;
        }
 
-       vector gco = get_closer_dest(this.goalcurrent, this.origin);
-
        // Run only to visible goals
        if(IS_ONGROUND(this))
        if(vdist(vec2(this.velocity), >=, autocvar_sv_maxspeed))
@@ -304,6 +305,7 @@ void havocbot_bunnyhop(entity this, vector dir)
                // seen it before
                if(this.bot_timelastseengoal)
                {
+                       vector gco = get_closer_dest(this.goalcurrent, this.origin);
                        // for a period of time
                        if(time - this.bot_timelastseengoal > autocvar_bot_ai_bunnyhop_firstjumpdelay)
                        {
@@ -1253,9 +1255,7 @@ void havocbot_movetogoal(entity this)
                havocbot_keyboard_movement(this, destorg);
 
        // Bunnyhop!
-       //if(this.aistatus & AI_STATUS_ROAMING)
-       if(!bunnyhop_forbidden && this.goalcurrent)
-       if(skill+this.bot_moveskill >= autocvar_bot_ai_bunnyhop_skilloffset)
+       if (!bunnyhop_forbidden && skill + this.bot_moveskill >= autocvar_bot_ai_bunnyhop_skilloffset)
                havocbot_bunnyhop(this, dir);
 
        if (dir * v_up >= autocvar_sv_jumpvelocity * 0.5 && IS_ONGROUND(this))
index 707043f3d99f4e89b0de66e2647c4287b7c151b8..c39457778f88798a759e610825d6e91a3959b5d5 100644 (file)
@@ -430,6 +430,7 @@ void cvar_changes_init()
                BADCVAR("g_physics_clientselect");
                BADCVAR("g_pinata");
                BADCVAR("g_powerups");
+               BADCVAR("g_player_brightness");
                BADCVAR("g_spawnshieldtime");
                BADCVAR("g_start_delay");
                BADCVAR("g_superspectate");
index e9120cac6b8d0e87c9036fa2b86fbfc23c42d5c6..dfa3c0c57c26f8efe0862618918f653612dbe750 100644 (file)
@@ -194,7 +194,7 @@ seta cl_autotaunt 0 "automatically taunt enemies when fragging them"
 seta cl_voice_directional 1    "0 = all voices are non-directional, 1 = all voices are directional, 2 = only taunts are directional"
 seta cl_voice_directional_taunt_attenuation 0.5 "this defines the distance from which taunts can be heard"
 
-seta cl_hitsound 1 "play a hit notifier sound when you have hit an enemy, 1: same pitch 2: increase pitch with more damage 3: decrease pitch with more damage"
+seta cl_hitsound 1 "play a hit notifier sound when you have hit an enemy, 1: same pitch 2: decrease pitch with more damage 3: increase pitch with more damage"
 set cl_hitsound_antispam_time 0.05 "don't play the hitsound more often than this"
 seta cl_hitsound_min_pitch 0.75 "minimum pitch of hit sound"
 seta cl_hitsound_max_pitch 1.5 "maximum pitch of hit sound"