Commit d7c85737 authored by MCMic's avatar MCMic

Avoid using unitialized var in corner cases (fixes cppcheck warning)

parent cd043e3f
Pipeline #5074023 passed with stage
in 7 minutes and 5 seconds
...@@ -461,10 +461,10 @@ int Game::DrawGLScene(StereoSide side) ...@@ -461,10 +461,10 @@ int Game::DrawGLScene(StereoSide side)
if (distance >= .5) { if (distance >= .5) {
checkpoint = DoRotation(Person::players[k]->skeleton.joints[abs(Random() % Person::players[k]->skeleton.num_joints)].position, 0, Person::players[k]->yaw, 0) * Person::players[k]->scale + Person::players[k]->coords; checkpoint = DoRotation(Person::players[k]->skeleton.joints[abs(Random() % Person::players[k]->skeleton.num_joints)].position, 0, Person::players[k]->yaw, 0) * Person::players[k]->scale + Person::players[k]->coords;
checkpoint.y += 1; checkpoint.y += 1;
int i; int i = -1;
if (!Person::players[k]->occluded == 0) if (Person::players[k]->occluded != 0)
i = checkcollide(viewer, checkpoint, Person::players[k]->lastoccluded); i = checkcollide(viewer, checkpoint, Person::players[k]->lastoccluded);
if (i == -1 || Person::players[k]->occluded == 0) if (i == -1)
i = checkcollide(viewer, checkpoint); i = checkcollide(viewer, checkpoint);
if (i != -1) { if (i != -1) {
Person::players[k]->occluded += 1; Person::players[k]->occluded += 1;
...@@ -526,10 +526,10 @@ int Game::DrawGLScene(StereoSide side) ...@@ -526,10 +526,10 @@ int Game::DrawGLScene(StereoSide side)
if (distance >= .5) { if (distance >= .5) {
checkpoint = DoRotation(Person::players[k]->skeleton.joints[abs(Random() % Person::players[k]->skeleton.num_joints)].position, 0, Person::players[k]->yaw, 0) * Person::players[k]->scale + Person::players[k]->coords; checkpoint = DoRotation(Person::players[k]->skeleton.joints[abs(Random() % Person::players[k]->skeleton.num_joints)].position, 0, Person::players[k]->yaw, 0) * Person::players[k]->scale + Person::players[k]->coords;
checkpoint.y += 1; checkpoint.y += 1;
int i; int i = -1;
if (!Person::players[k]->occluded == 0) if (Person::players[k]->occluded != 0)
i = checkcollide(viewer, checkpoint, Person::players[k]->lastoccluded); i = checkcollide(viewer, checkpoint, Person::players[k]->lastoccluded);
if (i == -1 || Person::players[k]->occluded == 0) if (i == -1)
i = checkcollide(viewer, checkpoint); i = checkcollide(viewer, checkpoint);
if (i != -1) { if (i != -1) {
Person::players[k]->occluded += 1; Person::players[k]->occluded += 1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment