Skip to content

Commit

Permalink
fix a divide by 0
Browse files Browse the repository at this point in the history
  • Loading branch information
atupone committed Jun 26, 2024
1 parent 999f094 commit 3eb6bdb
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/bzflag/effectsRenderer.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1038,9 +1038,8 @@ void FlashShotEffect::draw(const SceneRenderer &)
// - camerapos[1] * sin(-rotation[2]);
camerapos[1] = camerapos[1] * cos(-rotation[2])
+ camerapos[0] * sin(-rotation[2]);
glRotatef(270 - atan(camerapos[1] / camerapos[2]) / deg2Rad +
(camerapos[2] >= 0 ? 180 : 0), //for a single-sided face
0,1,0);
//for a single-sided face
glRotatef(std::atan2(camerapos[2], camerapos[1]) / deg2Rad, 0,1,0);

ringState.setState();

Expand Down

0 comments on commit 3eb6bdb

Please sign in to comment.