]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Bot AI: fix max fire deviation factor calculation (introduced in 4ae6e27ee) making...
authorterencehill <piuntn@gmail.com>
Tue, 23 Aug 2022 21:32:22 +0000 (23:32 +0200)
committerterencehill <piuntn@gmail.com>
Tue, 23 Aug 2022 21:32:22 +0000 (23:32 +0200)
qcsrc/server/bot/default/aim.qc
qcsrc/server/bot/default/cvars.qh
xonotic-server.cfg

index c7e23765c6722d33bbd50fb9c08d3953fa0055ed..96de17a747172a93202db1e09053cec518ad94df 100644 (file)
@@ -376,11 +376,9 @@ bool bot_aim(entity this, .entity weaponentity, float shotspeed, float shotspeed
        float dist = max(10, vlen(v - shotorg));
        float maxfiredeviation = 1000 / (dist - 9) - 0.35;
 
-       if (!shot_accurate)
-               maxfiredeviation *= 1.6;
-       else
-               maxfiredeviation *= 1 + bound(0, (10 - (skill + this.bot_aimskill)) * 0.3, 3);
-       maxfiredeviation = min(autocvar_bot_ai_aimskill_firetolerance_maxdegrees, maxfiredeviation);
+       float f = (shot_accurate) ? 1 : 1.6;
+       f += bound(0, (10 - (skill + this.bot_aimskill)) * 0.3, 3);
+       maxfiredeviation = min(90, maxfiredeviation * f);
 
        if (applygravity && this.bot_aimtarg)
        {
index 43a92f6be4670e81e8e6c370bc95210407785f2a..bd408da4218f283f381bdbecee835e050e2d742d 100644 (file)
@@ -2,7 +2,6 @@
 
 float autocvar_bot_ai_aimskill_blendrate;
 int autocvar_bot_ai_aimskill_firetolerance;
-float autocvar_bot_ai_aimskill_firetolerance_maxdegrees;
 float autocvar_bot_ai_aimskill_fixedrate;
 float autocvar_bot_ai_aimskill_mouse;
 float autocvar_bot_ai_aimskill_offset;
index e6bfecb833874128087a4a81e43bf233335f6126..a06cd2ec5bfaeeb570e5402d55f889779574861c 100644 (file)
@@ -139,7 +139,6 @@ set bot_ai_dangerdetectionupdates 64 "How many waypoints will be considered for
 set bot_ai_aimskill_blendrate 2 "How much correction will be applied to the aiming angle"
 set bot_ai_aimskill_fixedrate 15 "Distance based scale from which correction will be applied to the aiming angle"
 set bot_ai_aimskill_firetolerance 1 "enable fire tolerance"
-set bot_ai_aimskill_firetolerance_maxdegrees 60 "Maximum firing angle. Used on close range"
 set bot_ai_aimskill_mouse 1 "How much of the aiming filters are applied"
 set bot_ai_keyboard_distance 250 "Keyboard emulation is disabled after this distance to the goal"
 set bot_ai_keyboard_threshold 0.57