From: Mario Date: Mon, 19 Feb 2018 15:22:37 +0000 (+1000) Subject: Tweak the accidentally pushed CSQC model LOD support to work with large models X-Git-Tag: xonotic-v0.8.5~7^2~1^2~62 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=c4d70c1ab35c16a88cb70d98b1a400085e2cb5ec;p=xonotic%2Fxonotic-data.pk3dir.git Tweak the accidentally pushed CSQC model LOD support to work with large models --- diff --git a/qcsrc/client/csqcmodel_hooks.qc b/qcsrc/client/csqcmodel_hooks.qc index ebec91d625..2807f996aa 100644 --- a/qcsrc/client/csqcmodel_hooks.qc +++ b/qcsrc/client/csqcmodel_hooks.qc @@ -79,7 +79,7 @@ void CSQCPlayer_LOD_Apply(entity this, bool isplayer) } else { - float distance = vlen(this.origin - view_origin); + float distance = vlen(((isplayer) ? this.origin : NearestPointOnBox(this, view_origin)) - view_origin); // TODO: perhaps it should just use NearestPointOnBox all the time, player hitbox can potentially be huge float f = (distance * current_viewzoom + 100.0) * detailreduction; f *= 1.0 / bound(0.01, view_quality, 1); if(f > autocvar_cl_loddistance2)