Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- __int64 __fastcall MapInstance_sub_140835FC0(__int64 *rcx0, _DWORD *a2, int a3)
- {
- __int64 result; // rax
- int v4; // esi
- _DWORD *v5; // rdi
- __int64 v6; // rbx
- __int64 v7; // rsi
- __int64 v8; // rsi
- void *v9; // r15
- signed int v10; // xmm6_4
- signed __int64 v11; // rax
- __int64 *v12; // rax
- __int64 *v13; // rdi
- Create_t a1; // [rsp+30h] [rbp-D0h]
- set_info_t set_info; // [rsp+90h] [rbp-70h]
- result = *((unsigned int *)rcx0 + 2);
- v4 = a3;
- v5 = a2;
- v6 = (__int64)rcx0;
- if ( *((_DWORD *)rcx0 + 3) != (_DWORD)result || (result = BittestGameFlags(1), (_DWORD)result) || !v4 )
- {
- *(_DWORD *)(v6 + 56) = 5;
- }
- else
- {
- v7 = *(_QWORD *)v6;
- if ( !*(_QWORD *)v6 )
- {
- *(_DWORD *)(v6 + 12) = -1;
- LABEL_6:
- *(_DWORD *)(v6 + 56) = 3;
- return result;
- }
- if ( !*(_DWORD *)(v7 + 48) )
- goto LABEL_6;
- v8 = v7 + 8;
- if ( !v8 )
- {
- *(_DWORD *)(v6 + 12) = -1;
- *(_DWORD *)(v6 + 56) = 4;
- return result;
- }
- v9 = (void *)DataFile__sub_14026AC20((_QWORD *)(v8 + 8), "wmb", 0);
- if ( v9 )
- {
- Create_t::Invalidate(&a1);
- Matrix4x4::InitIndentity(&set_info.m_mat);
- v10 = 0;
- Vector3Aligned::sub_7FF696E25E40(&set_info.m_vPosition);
- Vector3Aligned::sub_7FF696E25E40(&set_info.m_vRotation);
- Vector3Aligned::sub_7FF696E25E40(&set_info.m_vScale);
- *(_QWORD *)&set_info.m_dwSetType = 0i64;
- *(_QWORD *)&set_info.m_i0x078 = 0i64;
- set_info.m_i0x080 = -1;
- set_info.m_i0x084 = 0;
- set_info.m_i0x088 = 1;
- set_info.m_i0x08C = -1;
- Vector3Aligned::Copy(&set_info.m_vPosition, (Vector3Aligned *)(v6 + 0x10));
- Vector3Aligned::sub_140265E60((unsigned __int64)&set_info.m_vRotation);
- Vector3Aligned::sub_140265E60((unsigned __int64)&set_info.m_vScale);
- set_info.m_i0x080 = *(_DWORD *)(v6 + 8);
- a1.m_ObjectIds[1] = 0x90001;
- a1.m_pSetInfo = &set_info;
- a1.m_szName = "MapInstance";
- a1.m_ObjectIds[0] = 0x90001;
- a1.m_dwFlags = 0x40000000;
- a1.m_pWMB = v9;
- a1.m_pDatBuffers = (void *)(v8 + 8);
- a1.m_pBXM = (void *)CObjReadManager::Work::QueryFilePointer((__int64 *)(v8 + 8), "ObjectParam.bxm");
- result = (__int64)CSceneEntitySystem::CreateEntity(&g_pSceneEntitySystem, &a1);
- *(_QWORD *)(v6 + 0x28) = result;
- if ( !result )
- return result;
- if ( v5 )
- {
- v11 = 0i64;
- while ( *v5 != -1 )
- {
- ++v11;
- v5 += 3;
- if ( v11 >= 14 )
- goto LABEL_21;
- }
- *v5 = *(_DWORD *)(v6 + 8);
- if ( stru_14102A000.m_ObjectId != 1 || (qword_1410297C0 & 0x80u) != 0i64 )
- v10 = 0x3F800000;
- v5[1] = v10;
- v5[2] = 0;
- }
- LABEL_21:
- *(_QWORD *)(v6 + 48) = CEntityInfo::GetParent(*(CEntityInfo **)(v6 + 40));
- *(_DWORD *)(v6 + 32) = 0;
- *(_DWORD *)(v6 + 36) = 1;
- *(_DWORD *)(v6 + 60) = 1;
- }
- if ( ((*(_DWORD *)v8 & 0xF0000) - 0x20000) & 0xFFFDFFFF )
- {
- v12 = sub_1407DA720(*(_DWORD *)v8);
- v13 = v12;
- if ( v12 )
- {
- if ( *(_DWORD *)v12 == 1 )
- {
- Vector3Aligned::Copy((Vector3Aligned *)v12 + 1, (Vector3Aligned *)(v6 + 16));
- *((_DWORD *)v13 + 8) = 0;
- *((_DWORD *)v13 + 10) = 0;
- *((_DWORD *)v13 + 34) = 0;
- *(_DWORD *)v13 = 2;
- }
- }
- }
- result = sub_1403D1A60((__int64)&unk_141274460, v8);
- *(_DWORD *)(v6 + 56) = 3;
- }
- return result;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement