]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commit
Fix fireBullet(), increase MAX_SHOT_DISTANCE
authorMartin Taibr <taibr.martin@gmail.com>
Fri, 2 Dec 2016 18:43:11 +0000 (19:43 +0100)
committerMartin Taibr <taibr.martin@gmail.com>
Fri, 2 Dec 2016 18:43:11 +0000 (19:43 +0100)
commitee2632301ca8c3068048721974e8752a14cc0ca8
tree871058ed8c07317cab9187f0285553f964249fc4
parent93d0294e57201226ce5b7c6df65e7d8512594c2d
Fix fireBullet(), increase MAX_SHOT_DISTANCE

Previously, when the nearest target was beyond MAX_SHOT_DISTANCE, the trace ended and the code assumed a wall was hit. It then proceeded to penetrate the non-existent wall up to g_ballistics_mindistance, dropping out of said wall and penetrating the next non-existent wall, repeatedly, until the weapon's solidpenetration was exhausted after going through 50 such walls with overkill's MG, resulting in massive FPS drops and lag spikes on large maps.

Now, if nothing is hit, we just bail out immediately.

Additionally, I increased MAX_SHOT_DISTANCE to make sure hitscan weapons like MG and vortex don't stop mid air even on large maps.
qcsrc/common/weapons/weapon.qh
qcsrc/server/weapons/tracing.qc