Skip to content

Commit

Permalink
Fix null refs
Browse files Browse the repository at this point in the history
  • Loading branch information
Fernthedev committed Jan 9, 2025
1 parent db2cc2d commit b2540d0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
6 changes: 4 additions & 2 deletions src/hooks/colorizer/Saber/SaberBurnMarkArea.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,10 @@ void OnSaberColorChanged_SaberBurnMarkArea(int saberType,
Sombrero::FastColor::RGBToHSV(color, h, s, _);
Sombrero::FastColor effectColor = Sombrero::FastColor::HSVToRGB(h, s, 1);
int intType = saberType;
lineRenderers[intType]->set_startColor(effectColor);
lineRenderers[intType]->set_endColor(effectColor);
if (lineRenderers[intType]) {
lineRenderers[intType]->set_startColor(effectColor);
lineRenderers[intType]->set_endColor(effectColor);
}
}

MAKE_HOOK_MATCH(SaberBurnMarkArea_Start, &SaberBurnMarkArea::Start, void, SaberBurnMarkArea* self) {
Expand Down
9 changes: 7 additions & 2 deletions src/hooks/colorizer/Saber/SaberBurnMarkSparkles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,13 @@ void OnSaberColorChanged(int saberType, GlobalNamespace::SaberModelController* /

Sombrero::FastColor::RGBToHSV(color, h, s, _);
Sombrero::FastColor effectColor = Sombrero::FastColor::HSVToRGB(h, s, 1);
ParticleSystem::MainModule main = burnMarksPS[saberType]->get_main();
main.set_startColor(ParticleSystem::MinMaxGradient::op_Implicit___UnityEngine__ParticleSystem_MinMaxGradient(effectColor));
auto burnMark = burnMarksPS[saberType];
if (!burnMark) return;

ParticleSystem::MainModule main = burnMark->get_main();
if (!main.m_ParticleSystem) return;
main.set_startColor(
ParticleSystem::MinMaxGradient::op_Implicit___UnityEngine__ParticleSystem_MinMaxGradient(effectColor));
}

MAKE_HOOK_MATCH(SaberBurnMarkSparkles_Start, &SaberBurnMarkSparkles::Start, void, SaberBurnMarkSparkles* self) {
Expand Down

0 comments on commit b2540d0

Please sign in to comment.