Skip to content

Commit

Permalink
Fix oangle's sign
Browse files Browse the repository at this point in the history
  • Loading branch information
SurFlurer committed Oct 11, 2024
1 parent 92ce84e commit 34c2d96
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lightmap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1313,9 +1313,9 @@ void map::apply_light_arc( const tripoint_bub_ms &p, const units::angle &angle,
cata::mdarray<float, point_bub_ms> &transparency_cache =
cache.transparency_cache;

// Normalize
const units::angle wangle = wideangle / 2.0;
const units::angle oangle = fmod( angle - wangle, 360_degrees );
// Normalize so oangle is between 0 and 360 degrees
const units::angle oangle = fmod( fmod( angle - wangle, 360_degrees ) + 360_degrees, 360_degrees );
const units::angle cangle = oangle + wideangle;

// Sweep over every octant
Expand Down

0 comments on commit 34c2d96

Please sign in to comment.