mirror of
https://github.com/geode-sdk/geode.git
synced 2024-11-30 11:17:08 -05:00
fix switchToMenu assuming nodes to have a parent
This commit is contained in:
parent
ff9231db18
commit
8027b807e5
1 changed files with 3 additions and 1 deletions
|
@ -35,7 +35,9 @@ void setIDs(CCNode* node, int startIndex, Args... args) {
|
||||||
static void switchToMenu(CCNode* node, CCMenu* menu) {
|
static void switchToMenu(CCNode* node, CCMenu* menu) {
|
||||||
if (!node || !menu) return;
|
if (!node || !menu) return;
|
||||||
|
|
||||||
auto worldPos = node->getParent()->convertToWorldSpace(node->getPosition());
|
auto worldPos = node->getParent() ?
|
||||||
|
node->getParent()->convertToWorldSpace(node->getPosition()) :
|
||||||
|
node->getPosition();
|
||||||
|
|
||||||
node->retain();
|
node->retain();
|
||||||
node->removeFromParent();
|
node->removeFromParent();
|
||||||
|
|
Loading…
Reference in a new issue