Skip to content

Commit

Permalink
Fix lighting crash immediately after hyperspace
Browse files Browse the repository at this point in the history
  • Loading branch information
sturnclaw committed Sep 4, 2023
1 parent 2176631 commit 3880376
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Camera.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,9 @@ void Camera::CalcLighting(const Body *b, double &ambient, double &direct) const
direct = 1.0;

Body *astro = Frame::GetFrame(b->GetFrame())->GetBody();
if (!astro)
return;

Planet *planet = static_cast<Planet *>(astro);
FrameId rotFrame = planet->GetFrame();

Expand Down

0 comments on commit 3880376

Please sign in to comment.