use virtual getChildren for getChildByID

This commit is contained in:
altalk23 2024-08-01 12:31:16 +03:00
parent bae22b4e34
commit fe730ed78b

View file

@ -122,7 +122,7 @@ void CCNode::setID(std::string const& id) {
}
CCNode* CCNode::getChildByID(std::string const& id) {
for (auto child : CCArrayExt<CCNode*>(m_pChildren)) {
for (auto child : CCArrayExt<CCNode*>(this->getChildren())) {
if (child->getID() == id) {
return child;
}