Skip to content

Commit

Permalink
maybe fix crash when lights cut with fireball
Browse files Browse the repository at this point in the history
  • Loading branch information
atar13 committed Jun 7, 2024
1 parent 6a0f4a0 commit aea58f5
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/client/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1478,7 +1478,10 @@ void Client::lightingPass() {
glm::vec3 flame_color = properties.diffuse_color;

animManager->setFrameAnimation(sharedObject->globalID, sharedObject->modelType, sharedObject->animState);
Model* fireball_frame_model = animManager->updateFrameAnimation(timeElapsed);
Model* fireball_frame_model = animManager->updateFrameAnimation(timeElapsed);
if (fireball_frame_model == nullptr) {
continue; // THIS IS BREAKING WHEN SUN GODS FIREBALLS ARE DESTROYED WHWEN LIGHTS ARE CUT
}

this->deferred_light_box_shader->setVec3("lightColor", flame_color);

Expand All @@ -1491,7 +1494,10 @@ void Client::lightingPass() {
glm::vec3 flame_color = properties.diffuse_color;

animManager->setFrameAnimation(sharedObject->globalID, sharedObject->modelType, sharedObject->animState);
Model* fireball_frame_model = animManager->updateFrameAnimation(timeElapsed);
Model* fireball_frame_model = animManager->updateFrameAnimation(timeElapsed);
if (fireball_frame_model == nullptr) {
continue; // THIS IS BREAKING WHEN SUN GODS FIREBALLS ARE DESTROYED WHWEN LIGHTS ARE CUT
}

this->deferred_light_box_shader->setVec3("lightColor", flame_color);

Expand Down

0 comments on commit aea58f5

Please sign in to comment.