Advertisement
Guest User

Untitled

a guest
Apr 9th, 2020
226
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 6.53 KB | None | 0 0
  1. void __usercall AI_EntityHumanModel::Update(Thing *this@<ecx>, double a2@<st0>)
  2. {
  3.   // [COLLAPSED LOCAL DECLARATIONS. PRESS KEYPAD CTRL-"+" TO EXPAND]
  4.  
  5.   v3 = this->dword758;
  6.   v4 = 0;
  7.   if ( v3 && AI_AdvancedWeaponPC::UpdateAsyncLoad(v3, 0) )
  8.   {
  9.     sub_10070770(this->dword758, a2);
  10.     v5 = this->dword758;
  11.     sub_1014BBC0(this);
  12.     sub_1014C5B0(v5);
  13.     if ( this->byte960 )
  14.       sub_1014BF70(1);
  15.     this->dword758 = 0;
  16.   }
  17.   if ( this->arm1.dword0 != -1 )
  18.   {
  19.     if ( cObjectManagerInstance )
  20.     {
  21.       v6 = sub_1003E370(this->arm1.dword8);
  22.       this->arm1.dword4 = v6;
  23.       if ( v6 != 0 )
  24.       {
  25.         if ( BYTE1(this->arm1.dwordC) )
  26.         {
  27.           if ( cObjectManagerInstance )
  28.           {
  29.             v7 = sub_1003E370(this->dword760);
  30.             this->dword75C = v7;
  31.           }
  32.           else
  33.           {
  34.             v7 = 0;
  35.           }
  36.           v8 = AIDLL::ACT_AnimLayer_AIFlagActive(v7, 0x6Cu) == 0;
  37.           if ( LOBYTE(this->arm1.dwordC) != v8 )
  38.           {
  39.             __asm
  40.             {
  41.               fld     ds:flt_10278A40
  42.               fstp    [esp+484h+var_484]; float
  43.             }
  44.             v9 = &this->arm1;
  45.             if ( v8 )
  46.               cIkArm::On(v9, v44);
  47.             else
  48.               cIkArm::Off(v9, v44);
  49.           }
  50.         }
  51.       }
  52.     }
  53.   }
  54.   if ( this->arm2.dword0 != -1 )
  55.   {
  56.     if ( cObjectManagerInstance )
  57.     {
  58.       v10 = sub_1003E370(this->arm2.dword8);
  59.       this->arm2.dword4 = v10;
  60.       if ( v10 != 0 )
  61.       {
  62.         if ( BYTE1(this->arm2.dwordC) )
  63.         {
  64.           if ( cObjectManagerInstance )
  65.           {
  66.             v11 = sub_1003E370(this->dword760);
  67.             this->dword75C = v11;
  68.           }
  69.           else
  70.           {
  71.             v11 = 0;
  72.           }
  73.           v12 = AIDLL::ACT_AnimLayer_AIFlagActive(v11, 0x6Du) == 0;
  74.           if ( LOBYTE(this->arm2.dwordC) != v12 )
  75.           {
  76.             __asm
  77.             {
  78.               fld     ds:flt_10278A40
  79.               fstp    [esp+484h+var_484]; float
  80.             }
  81.             v13 = &this->arm2;
  82.             if ( v12 )
  83.               cIkArm::On(v13, v45);
  84.             else
  85.               cIkArm::Off(v13, v45);
  86.           }
  87.         }
  88.       }
  89.     }
  90.   }
  91.   if ( this->byte95F )
  92.   {
  93.     if ( cObjectManagerInstance )
  94.     {
  95.       v14 = sub_1003E370(this->dword760);
  96.       this->dword75C = v14;
  97.       v4 = v14;
  98.     }
  99.     if ( cObjectManagerInstance )
  100.     {
  101.       v16 = sub_1003E370(this->dword760);
  102.       this->dword75C = v16;
  103.       v15 = v16;
  104.     }
  105.     else
  106.     {
  107.       v15 = 0;
  108.     }
  109.     v17 = AIDLL::VIS_uc_GetJointIndex(v4, 0x58988870);
  110.     AIDLL::VIS_GetJoint_Pos(&v50, v15, v17, 0);
  111.     if ( cObjectManagerInstance )
  112.     {
  113.       v19 = sub_1003E370(this->dword760);
  114.       this->dword75C = v19;
  115.       v18 = v19;
  116.     }
  117.     else
  118.     {
  119.       v18 = 0;
  120.     }
  121.     if ( cObjectManagerInstance )
  122.     {
  123.       v21 = sub_1003E370(this->dword760);
  124.       this->dword75C = v21;
  125.       v20 = v21;
  126.     }
  127.     else
  128.     {
  129.       v20 = 0;
  130.     }
  131.     v22 = AIDLL::VIS_uc_GetJointIndex(v18, 0x9B14362C);
  132.     AIDLL::VIS_GetJoint_Pos(&v47, v20, v22, 0);
  133.     __asm
  134.     {
  135.       fld     [ebp+var_434]
  136.       fadd    [ebp+var_428]
  137.     }
  138.     v57 = v51;
  139.     __asm
  140.     {
  141.       fstp    [ebp+var_410]
  142.       fld     [ebp+var_40C]
  143.     }
  144.     v58 = v52;
  145.     __asm
  146.     {
  147.       fadd    [ebp+var_430]
  148.       fstp    [ebp+var_40C]
  149.       fld     [ebp+var_408]
  150.     }
  151.     v54 = v57;
  152.     __asm
  153.     {
  154.       fadd    [ebp+var_42C]
  155.       fstp    [ebp+var_408]
  156.       fld     [ebp+var_410]
  157.     }
  158.     v55 = v58;
  159.     __asm
  160.     {
  161.       fld     ds:dbl_102788D0
  162.       fmul    st(1), st
  163.       fxch    st(1)
  164.       fstp    [ebp+var_41C]
  165.       fld     [ebp+var_418]
  166.       fmul    st, st(1)
  167.       fstp    [ebp+var_418]
  168.       fmul    [ebp+var_414]
  169.       fstp    [ebp+var_414]
  170.     }
  171.     if ( cObjectManagerInstance )
  172.     {
  173.       v23 = sub_1003E370(this->dword760);
  174.       this->dword75C = v23;
  175.     }
  176.     else
  177.     {
  178.       v23 = 0;
  179.     }
  180.     _EAX = AIDLL::OBJ_vGetPos(&v56, v23);
  181.     __asm
  182.     {
  183.       fld     dword ptr [eax+8]
  184.       fstp    [ebp+var_414]
  185.     }
  186.     if ( cObjectManagerInstance )
  187.     {
  188.       v25 = sub_1003E370(this->dword8E8);
  189.       this->dword8E4 = v25;
  190.       if ( v25 != 0 )
  191.       {
  192.         if ( cObjectManagerInstance )
  193.         {
  194.           v27 = sub_1003E370(this->dword760);
  195.           this->dword75C = v27;
  196.           v26 = v27;
  197.         }
  198.         else
  199.         {
  200.           v26 = 0;
  201.         }
  202.         if ( cObjectManagerInstance )
  203.         {
  204.           v29 = sub_1003E370(this->dword8E8);
  205.           this->dword8E4 = v29;
  206.           v28 = v29;
  207.         }
  208.         else
  209.         {
  210.           v28 = 0;
  211.         }
  212.         v30 = AIDLL::OBJ_mxGetMatrix(&v46, v26);
  213.         AIDLL::OBJ_SetMatrix(v28, v30);
  214.         if ( cObjectManagerInstance )
  215.         {
  216.           v31 = sub_1003E370(this->dword8E8);
  217.           this->dword8E4 = v31;
  218.         }
  219.         else
  220.         {
  221.           v31 = 0;
  222.         }
  223.         AIDLL::OBJ_SetPos(v31, &v53);
  224.       }
  225.     }
  226.   }
  227.   if ( this->importantSwitch )
  228.   {
  229.     v57 = 0.0;
  230.     v58 = 0.0;
  231.     v32 = !this->dword758 && this->dword754;
  232.     if ( cObjectManagerInstance )
  233.     {
  234.       v33 = sub_1003E370(this->dword760);
  235.       this->dword75C = v33;
  236.     }
  237.     else
  238.     {
  239.       v33 = 0;
  240.     }
  241.     v35 = AI_CharacterVisualManager::Get();
  242.     v36 = AI_CharacterVisualManager::LoadCharacterVisualsAsync(v35, a2, v33, &this->characterVisuals, &v57, 0);
  243.     if ( v32 )
  244.     {
  245.       if ( v36 )
  246.       {
  247.         v37 = AI_CharacterVisualManager::Get();
  248.         if ( AI_CharacterVisualManager::eTestParams(v37, a2, &this->characterVisuals) )
  249.         {
  250.           v38 = RDV::Proxy::pUserModel();
  251.           v39 = RDV::Proxy::pUserModel();
  252.           v40 = (v38->pVMT->pRDV_DLL_sub_10010055)(v38);
  253.           playerID = (v39->pVMT->pRDV_DLL_sub_1000A14B_getPlayerID)(v39, *v40, this->dword958);
  254.           sprintf(
  255.             &v59,
  256.             "Invalid visual params after loading character. PID = %d. UserName = %s. ClassID = %d",
  257.             playerID,
  258.             userName,
  259.             classID);
  260.           dword_1069A838 = rev_SendErrorMessage(
  261.                              dword_1069A838 != 1,
  262.                              "..\\SRC\\PCGUI\\3DRenderer\\AI_EntityHumanModel.cpp",
  263.                              "AI_EntityHumanModel::Update",
  264.                              469,
  265.                              &v59);
  266.           if ( dword_1069A838 == 3 )
  267.             __debugbreak();
  268.         }
  269.         this->importantSwitch = 0;
  270.       }
  271.     }
  272.   }
  273. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement