make -gate affect linear falloff lights as well

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
This commit is contained in:
Kevin Shanahan 2013-04-06 13:25:11 +10:30
parent ee2dc38f71
commit c193c18d5b
2 changed files with 3 additions and 1 deletions

View File

@ -14,6 +14,7 @@ Unreleased
* light: remove support for negative color components (never worked properly)
* light: removed the "-nominlimit" option (now the default behaviour)
* light: removed the "-compress" option (a bad idea from long ago)
* light: make -gate command line affect linear falloff lights as well
* vis: changed the default testlevel to 4
* vis: added the '-noambient*' options to disable auto ambient sounds.

View File

@ -198,7 +198,8 @@ CheckEntityFields(entity_t *entity)
if (entity->formula == LF_LINEAR) {
/* Linear formula always has a falloff point */
entity->fadedist = fabs(entity->light.light / entity->atten / scaledist);
entity->fadedist = fabs(entity->light.light) - fadegate;
entity->fadedist = entity->fadedist / entity->atten / scaledist;
} else if (fadegate < EQUAL_EPSILON) {
/* If fadegate is tiny, other lights have effectively infinite reach */
entity->fadedist = VECT_MAX;