@@ -113,24 +113,27 @@ void GolSceneTransformNode::VTable0x24(const GolMatrix34* p_m)
113113// STUB: GOLDP 0x10014c20
114114void GolSceneTransformNode::VTable0x20 (const GolMatrix4& p_m)
115115{
116+ LegoU32 i = 0 ;
117+
116118 if (m_unk0x14 == NULL ) {
117- for (LegoU32 i = 0 ; i < m_capacity; i++) {
118- GolTransform* obj = &m_unk0x18[i];
119+ GolTransform* obj = m_unk0x18;
120+ GolTransform* end = &m_unk0x18[m_capacity];
121+
122+ for (; obj < end; obj++) {
119123 GolTransform* parent = static_cast <GolTransform*>(obj->m_unk0x04 );
120- if (parent ! = NULL ) {
121- GolMath::FUN_1002f450 (obj->m_unk0x10 , parent-> m_unk0x90 , &obj->m_unk0x90 );
124+ if (parent = = NULL ) {
125+ GolMath::FUN_1002f450 (obj->m_unk0x10 , p_m , &obj->m_unk0x90 );
122126 }
123127 else {
124- GolMath::FUN_1002f450 (obj->m_unk0x10 , p_m , &obj->m_unk0x90 );
128+ GolMath::FUN_1002f450 (obj->m_unk0x10 , parent-> m_unk0x90 , &obj->m_unk0x90 );
125129 }
126130 }
127131 return ;
128132 }
129133
130- for (LegoU32 i = 0 ; i < m_capacity; i++) {
134+ for (; i < m_capacity; i++) {
131135 GolTransform* obj = &m_unk0x18[i];
132136 GolTransform* parent = static_cast <GolTransform*>(obj->m_unk0x04 );
133- const GolMatrix4& parentMatrix = parent != NULL ? parent->m_unk0x90 : p_m;
134137
135138 if (m_unk0x14->VTable0x00 (i)) {
136139 GolQuat rotation;
@@ -141,10 +144,20 @@ void GolSceneTransformNode::VTable0x20(const GolMatrix4& p_m)
141144 position.m_y = obj->m_unk0x10 .m_m [3 ][1 ];
142145 position.m_z = obj->m_unk0x10 .m_m [3 ][2 ];
143146
144- m_unk0x14->VTable0x04 (i, rotation, position, parentMatrix, &obj->m_unk0x90 );
147+ if (parent != NULL ) {
148+ m_unk0x14->VTable0x04 (i, rotation, position, parent->m_unk0x90 , &obj->m_unk0x90 );
149+ }
150+ else {
151+ m_unk0x14->VTable0x04 (i, rotation, position, p_m, &obj->m_unk0x90 );
152+ }
145153 }
146154 else {
147- GolMath::FUN_1002f450 (obj->m_unk0x10 , parentMatrix, &obj->m_unk0x90 );
155+ if (parent != NULL ) {
156+ GolMath::FUN_1002f450 (obj->m_unk0x10 , parent->m_unk0x90 , &obj->m_unk0x90 );
157+ }
158+ else {
159+ GolMath::FUN_1002f450 (obj->m_unk0x10 , p_m, &obj->m_unk0x90 );
160+ }
148161 }
149162 }
150163}
0 commit comments