From c4d70c1ab35c16a88cb70d98b1a400085e2cb5ec Mon Sep 17 00:00:00 2001 From: Mario Date: Tue, 20 Feb 2018 01:22:37 +1000 Subject: [PATCH] Tweak the accidentally pushed CSQC model LOD support to work with large models --- qcsrc/client/csqcmodel_hooks.qc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) -- 2.39.2