Defer change_segment_light multiply

If light_intensity is zero, skip the multiplication.
This commit is contained in:
Kp 2016-01-09 16:38:11 +00:00
parent 4770d3a35e
commit 3aefd0bf2f

View file

@ -1617,13 +1617,10 @@ static void change_segment_light(const vsegptridx_t segp,int sidenum,int dir)
fix light_intensity;
light_intensity = TmapInfo[sidep->tmap_num].lighting + TmapInfo[sidep->tmap_num2 & 0x3fff].lighting;
light_intensity *= dir;
if (light_intensity) {
const auto segment_center = compute_segment_center(segp);
visited_segment_bitarray_t visited;
apply_light_to_segment(visited, segp,segment_center,light_intensity,0);
apply_light_to_segment(visited, segp, segment_center, light_intensity * dir, 0);
}
}