@@ -120,7 +120,7 @@ class $modify(CustomCommentCell, CommentCell) {
120120
121121 CCMenuItemSpriteExtra* badge_api_plus = typeinfo_cast<CCMenuItemSpriteExtra*>(this ->getChildByIDRecursive (" badgeAPI-plus-badge" ));
122122 if (badge_api_plus) {
123- auto badge_api_plus_item = static_cast <CCArray*>(badge_api_plus->getUserObject ());
123+ auto badge_api_plus_item = static_cast <CCArray*>(static_cast <CCNode*>( badge_api_plus) ->getUserObject ());
124124
125125 // Check if badges are already loaded on BadgeMenu and then remove those on the profile page
126126 CCObject* childObj;
@@ -177,6 +177,7 @@ class $modify(CustomCommentCell, CommentCell) {
177177 new_child->setID (child->getID ());
178178 new_child->setTag (child->getTag ());
179179 new_child->setNormalImage (sprite);
180+ new_child->setUserObject (child->getUserObject ());
180181 new_child->updateSprite ();
181182 childsRescaled->addObject (new_child);
182183 } else {
@@ -191,8 +192,6 @@ class $modify(CustomCommentCell, CommentCell) {
191192 }
192193
193194 void loadFromComment (GJComment* p0) {
194- if (this ->getChildByIDRecursive (" mod-badge" )) this ->getChildByIDRecursive (" mod-badge" )->removeFromParent ();
195-
196195 CommentCell::loadFromComment (p0);
197196
198197 if (m_fields->loaded ) {
@@ -362,8 +361,6 @@ class $modify(CustomProfilePage, ProfilePage) {
362361 }
363362
364363 void loadPageFromUserInfo (GJUserScore* a2) {
365- if (this ->getChildByIDRecursive (" mod-badge" )) this ->getChildByIDRecursive (" mod-badge" )->removeFromParent ();
366-
367364 ProfilePage::loadPageFromUserInfo (a2);
368365
369366 if (m_fields->loaded ) {
0 commit comments