- make distancecheck 3D and use the actual view position for calculation.

This commit is contained in:
Christoph Oelckers 2016-04-13 10:48:39 +02:00
commit d88a5ac353
3 changed files with 7 additions and 2 deletions

View file

@ -1248,7 +1248,7 @@ void R_AddSprites (sector_t *sec, int lightlevel, int fakeside)
FIntCVar *cvar = thing->GetClass()->distancecheck;
if (cvar != NULL && *cvar >= 0)
{
double dist = thing->Distance2DSquared(camera);
double dist = (thing->PosRelative(viewsector) - ViewPos).LengthSquared();
double check = (double)**cvar;
if (dist >= check * check)
{