Skip to content

Commit

Permalink
Maybe fix funny crash
Browse files Browse the repository at this point in the history
  • Loading branch information
Alphalaneous committed Sep 2, 2024
1 parent 53a7b3b commit fe36a2a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 14 deletions.
2 changes: 1 addition & 1 deletion mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"android": "2.206",
"mac": "2.206"
},
"version": "v1.4.2",
"version": "v1.4.3",
"id": "alphalaneous.happy_textures",
"name": "Happy Textures :3",
"developer": "Alphalaneous",
Expand Down
25 changes: 12 additions & 13 deletions src/nodes/CCScale9Sprite.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,29 +44,28 @@ class $modify(MyCCScale9Sprite, CCScale9Sprite){

void updateSprites(){


CCSprite* topLeft = public_cast(this, _topLeft);
topLeft->setID("top-left");
CCSprite* top = public_cast(this, _top);
top->setID("top");
CCSprite* topRight = public_cast(this, _topRight);
topRight->setID("top-right");
CCSprite* left = public_cast(this, _left);
left->setID("left");
CCSprite* center = public_cast(this, _centre);
center->setID("center");
CCSprite* right = public_cast(this, _right);
right->setID("right");
CCSprite* bottomLeft = public_cast(this, _bottomLeft);
bottomLeft->setID("bottom-left");
CCSprite* bottom = public_cast(this, _bottom);
bottom->setID("bottom");
CCSprite* bottomRight = public_cast(this, _bottomRight);
bottomRight->setID("bottom-right");

if(!(topLeft && topRight && bottomRight && bottomLeft && center)) {
return;
}
if (!topLeft || !top || !topRight || !left || !center || !right || !bottomLeft || !bottom || !bottomRight) return;

topLeft->setID("top-left");
top->setID("top");
topRight->setID("top-right");
left->setID("left");
center->setID("center");
right->setID("right");
bottomLeft->setID("bottom-left");
bottom->setID("bottom");
bottomRight->setID("bottom-right");

if(m_fields->setOriginalRects){
m_fields->originalRects.push_back(topLeft->getTextureRect());
Expand Down

0 comments on commit fe36a2a

Please sign in to comment.