diff --git a/about.md b/about.md index 754ee73..75692c5 100644 --- a/about.md +++ b/about.md @@ -7,7 +7,7 @@ Makes the Epic, Legendary and Mythic fires animated! # Credits - Uproxide - Brift -- hiimjustin00 (Pretty Much rewrote it lmbao) +- hiimjasmine00 (Pretty Much rewrote it lmbao) - ShineUA (Clipping Node on Level Cell) - Cooper (help with sprite animations) diff --git a/mod.json b/mod.json index 09b1d3d..0e3eade 100644 --- a/mod.json +++ b/mod.json @@ -11,7 +11,7 @@ "version": "v1.1.2", "developers": [ "Uproxide", - "hiimjustin00", + "hiimjasmine00", "Brift" ], "description": "Makes the Epic, Legendary and Mythic fires animated!", diff --git a/src/hooks/LevelCell.cpp b/src/hooks/LevelCell.cpp index 50bf49e..69d4e7b 100644 --- a/src/hooks/LevelCell.cpp +++ b/src/hooks/LevelCell.cpp @@ -22,8 +22,10 @@ class $modify(MyLevelCell, LevelCell) { if (!Loader::get()->isModLoaded("cdc.level_thumbnails")) return; - queueInMainThread([this, difficultyNode, difficultySpr, level] { - if (!getParent() || !typeinfo_cast(getParent())) return; + auto hasCoins = level->m_coins > 0; + auto parent = getParent(); + queueInMainThread([parent = Ref(parent), difficultyNode, difficultySpr, hasCoins] { + if (!typeinfo_cast(parent.data())) return; auto fireSprite = difficultyNode->getChildByID("animated-fire-sprite"_spr); if (!fireSprite) { @@ -40,7 +42,7 @@ class $modify(MyLevelCell, LevelCell) { clippingNode->setPosition(fireSprite->getPosition()); clippingNode->setScale(fireSprite->getScale()); - if (auto bgNode = static_cast(getParent()->getChildByID("background"))) { + if (auto bgNode = parent->getChildByID("background")) { clippingNode->setStencil(CCLayerColor::create( {0, 0, 0, 255}, fireSprite->getContentWidth(), @@ -48,7 +50,7 @@ class $modify(MyLevelCell, LevelCell) { + bgNode->getContentHeight() - difficultyNode->getPositionY() - clippingNode->getPositionY() - - 6.0f - (level->m_coins > 0 ? 9.0f : 0.0f) + - 6.0f - (hasCoins > 0 ? 9.0f : 0.0f) )); }