Untitled

From Scorching Bee, 11 Years ago, written in C, viewed 769 times. This paste will explode in 1 Second.
URL https://paste.godclan.hu/view/2HnhCSMN Embed
Download Paste or View Raw
  1. int __thiscall CCamera__CamControl(CCamera *this)
  2. {
  3.   CCamera *thiss; // ebp@1
  4.   CPad *v2; // eax@16
  5.   CPlayerPed *v3; // eax@16
  6.   CAutomobile *v4; // edi@21
  7.   char v5; // cl@21
  8.   CEntity *v6; // esi@26
  9.   char v7; // al@26
  10.   CPad *v8; // eax@30
  11.   CPad *v9; // eax@37
  12.   double v10; // st6@45
  13.   double v11; // st7@50
  14.   CEntity *v12; // edx@53
  15.   int v13; // ebx@58
  16.   int v14; // eax@62
  17.   int v15; // eax@69
  18.   int v16; // eax@69
  19.   int v17; // eax@71
  20.   float v18; // ST2C_4@71
  21.   float v19; // ST28_4@71
  22.   float v20; // ST24_4@71
  23.   float v21; // STA0_4@71
  24.   float v22; // ST28_4@75
  25.   float v23; // ST24_4@75
  26.   float v24; // ST2C_4@75
  27.   float v25; // ST28_4@75
  28.   float v26; // ST24_4@75
  29.   float v27; // ST2C_4@75
  30.   float v28; // STA4_4@75
  31.   int v29; // eax@76
  32.   int v30; // ecx@76
  33.   int v31; // eax@78
  34.   int v32; // eax@78
  35.   int v33; // eax@79
  36.   int v34; // eax@79
  37.   int v35; // edx@83
  38.   float v36; // ST28_4@84
  39.   float v37; // ST24_4@84
  40.   char *v38; // eax@84
  41.   float v39; // ST2C_4@86
  42.   float v40; // ST28_4@86
  43.   float *v41; // eax@86
  44.   char *v42; // eax@89
  45.   int v43; // eax@91
  46.   int v44; // esi@96
  47.   float v45; // ST28_4@98
  48.   char *v46; // eax@98
  49.   signed int v47; // eax@118
  50.   double v48; // st7@118
  51.   double v49; // st6@122
  52.   float v50; // ST9C_4@133
  53.   int v51; // edx@138
  54.   int v52; // ecx@138
  55.   char v53; // al@142
  56.   double v54; // st6@143
  57.   double v55; // st7@143
  58.   double v56; // st5@144
  59.   double v57; // st7@146
  60.   double v58; // st5@147
  61.   double v59; // st7@151
  62.   double v60; // st7@152
  63.   double v61; // st5@153
  64.   double v62; // st7@156
  65.   double v63; // st5@157
  66.   double v64; // st6@161
  67.   double v65; // st7@161
  68.   double v66; // st5@162
  69.   double v67; // st7@164
  70.   double v68; // st5@165
  71.   char *v69; // eax@171
  72.   CPad *v70; // eax@178
  73.   CPad *v71; // eax@190
  74.   double v72; // st6@202
  75.   CPad *v73; // eax@212
  76.   CPad *v74; // eax@213
  77.   CPad *v75; // eax@216
  78.   CPad *v76; // eax@217
  79.   CPad *v77; // eax@224
  80.   CPed *v78; // eax@227
  81.   CPad *v79; // eax@231
  82.   double v80; // st7@232
  83.   char v81; // al@238
  84.   double v82; // st6@239
  85.   double v83; // st7@239
  86.   double v84; // st5@240
  87.   double v85; // st7@242
  88.   double v86; // st5@243
  89.   double v87; // st7@249
  90.   double v88; // st7@250
  91.   double v89; // st5@251
  92.   double v90; // st7@254
  93.   double v91; // st5@255
  94.   double v92; // st6@259
  95.   double v93; // st7@259
  96.   double v94; // st5@260
  97.   double v95; // st7@262
  98.   double v96; // st5@263
  99.   char *v97; // eax@269
  100.   int v98; // ebx@277
  101.   int v99; // eax@280
  102.   int v100; // eax@285
  103.   int v101; // eax@288
  104.   int v102; // eax@288
  105.   int v103; // eax@289
  106.   float v104; // ST2C_4@289
  107.   float v105; // ST28_4@289
  108.   float v106; // ST24_4@289
  109.   float v107; // STAC_4@289
  110.   float v108; // ST28_4@294
  111.   float v109; // ST24_4@294
  112.   int v110; // eax@300
  113.   int v111; // eax@301
  114.   int v112; // edi@301
  115.   int v113; // eax@303
  116.   int v114; // eax@303
  117.   int v115; // eax@304
  118.   int v116; // eax@304
  119.   int v117; // esi@309
  120.   float v118; // ST28_4@310
  121.   float v119; // ST24_4@310
  122.   char *v120; // eax@310
  123.   float v121; // ST2C_4@312
  124.   float v122; // ST28_4@312
  125.   float *v123; // eax@312
  126.   char *v124; // eax@315
  127.   int v125; // eax@317
  128.   int v126; // ecx@323
  129.   float v127; // ST28_4@325
  130.   char *v128; // eax@325
  131.   CPlayerPed *v129; // eax@331
  132.   int v130; // eax@331
  133.   int v131; // eax@331
  134.   int v132; // edi@350
  135.   float v133; // ST2C_4@350
  136.   float v134; // ST28_4@350
  137.   float v135; // ST24_4@350
  138.   float v136; // ST2C_4@350
  139.   float v137; // STB0_4@350
  140.   int v138; // eax@351
  141.   float v139; // ST2C_4@351
  142.   float v140; // ST28_4@351
  143.   float v141; // ST24_4@351
  144.   float v142; // ST2C_4@351
  145.   float v143; // STB4_4@351
  146.   int v144; // edx@359
  147.   int v145; // ecx@359
  148.   CPad *v146; // eax@365
  149.   __int16 v147; // ax@370
  150.   int v148; // eax@385
  151.   float v149; // STE0_4@392
  152.   float v150; // ST2C_4@392
  153.   double v151; // st7@392
  154.   float v152; // STE4_4@392
  155.   double v153; // st6@392
  156.   float v154; // ST2C_4@392
  157.   double i; // st7@393
  158.   float v156; // ST2C_4@399
  159.   float v157; // STBC_4@399
  160.   double v158; // st7@403
  161.   int v159; // ST30_4@415
  162.   int v160; // eax@415
  163.   float v161; // STC0_4@415
  164.   float v162; // STC4_4@415
  165.   int v163; // eax@415
  166.   RwV3D *v164; // eax@416
  167.   char v165; // dl@422
  168.   CPlayerPed *v166; // ecx@424
  169.   CEntity *v167; // esi@441
  170.   signed int j; // edi@442
  171.   int v169; // eax@443
  172.   int v170; // ebx@445
  173.   int v171; // eax@445
  174.   float v172; // ST2C_4@445
  175.   float v173; // ST28_4@445
  176.   float v174; // ST24_4@445
  177.   float v175; // STC8_4@445
  178.   float v176; // STCC_4@445
  179.   CEntity *v177; // esi@464
  180.   int v178; // eax@484
  181.   char v179; // al@485
  182.   CEntity *v180; // ecx@487
  183.   __int16 v181; // si@513
  184.   __int16 v182; // di@517
  185.   __int16 v183; // cx@529
  186.   CEntity *v184; // edi@538
  187.   char v185; // zf@539
  188.   __int16 v186; // bx@541
  189.   int v187; // edx@545
  190.   __int16 v188; // ax@545
  191.   float v189; // ST98_4@562
  192.   int v190; // eax@563
  193.   CPlayerPed *v191; // eax@564
  194.   int v192; // eax@564
  195.   int v193; // eax@579
  196.   char v194; // bl@584
  197.   CEntity *v195; // esi@587
  198.   char v196; // al@593
  199.   int v197; // edx@608
  200.   CEntity *v198; // ecx@608
  201.   int v199; // edx@610
  202.   __int16 v200; // si@612
  203.   char v201; // bl@613
  204.   CPlayerPed *v202; // eax@622
  205.   CPlayerPed *v203; // eax@622
  206.   CPlayerPed *v204; // eax@622
  207.   CEntity *v205; // ecx@622
  208.   float v206; // STD0_4@624
  209.   float v207; // STD4_4@624
  210.   int v208; // ebx@638
  211.   __int16 v209; // ax@644
  212.   char v210; // al@652
  213.   int v211; // ebx@659
  214.   int v212; // ecx@671
  215.   __int16 v213; // di@673
  216.   CPlayerPed *v214; // eax@680
  217.   CPlayerPed *v215; // eax@681
  218.   char v216; // bl@682
  219.   __int16 v217; // si@685
  220.   int result; // eax@685
  221.   CPad *v219; // eax@689
  222.   int *v220; // [sp+8h] [bp-40Ch]@416
  223.   void *v221; // [sp+8h] [bp-40Ch]@608
  224.   int v222; // [sp+Ch] [bp-408h]@0
  225.   char v223; // [sp+Ch] [bp-408h]@639
  226.   char v224; // [sp+14h] [bp-400h]@541
  227.   char v225; // [sp+18h] [bp-3FCh]@385
  228.   signed int v226; // [sp+1Ch] [bp-3F8h]@71
  229.   signed int v227; // [sp+20h] [bp-3F4h]@289
  230.   char v228; // [sp+24h] [bp-3F0h]@639
  231.   char v229; // [sp+28h] [bp-3ECh]@76
  232.   char v230; // [sp+2Ch] [bp-3E8h]@301
  233.   char v231; // [sp+30h] [bp-3E4h]@441
  234.   char v232; // [sp+34h] [bp-3E0h]@3
  235.   char v233; // [sp+38h] [bp-3DCh]@3
  236.   char v234; // [sp+3Ch] [bp-3D8h]@3
  237.   int v235; // [sp+40h] [bp-3D4h]@3
  238.   RwMatrix *v236; // [sp+44h] [bp-3D0h]@53
  239.   char v237; // [sp+48h] [bp-3CCh]@424
  240.   char v238; // [sp+4Ch] [bp-3C8h]@464
  241.   float v239; // [sp+50h] [bp-3C4h]@20
  242.   float v240; // [sp+54h] [bp-3C0h]@20
  243.   float v241; // [sp+58h] [bp-3BCh]@91
  244.   float v242; // [sp+5Ch] [bp-3B8h]@317
  245.   float v243; // [sp+60h] [bp-3B4h]@383
  246.   float v244; // [sp+64h] [bp-3B0h]@392
  247.   float v245; // [sp+68h] [bp-3ACh]@392
  248.   float v246; // [sp+6Ch] [bp-3A8h]@390
  249.   float v247; // [sp+70h] [bp-3A4h]@403
  250.   float v248; // [sp+84h] [bp-390h]@133
  251.   float v249; // [sp+94h] [bp-380h]@392
  252.   float v250; // [sp+B4h] [bp-360h]@78
  253.   float v251; // [sp+B8h] [bp-35Ch]@303
  254.   float v252; // [sp+CCh] [bp-348h]@75
  255.   float v253; // [sp+D0h] [bp-344h]@75
  256.   float v254; // [sp+D4h] [bp-340h]@75
  257.   float v255; // [sp+D8h] [bp-33Ch]@71
  258.   float v256; // [sp+DCh] [bp-338h]@71
  259.   float v257; // [sp+E0h] [bp-334h]@71
  260.   char v258; // [sp+E4h] [bp-330h]@90
  261.   int v259; // [sp+ECh] [bp-328h]@74
  262.   float v260; // [sp+F0h] [bp-324h]@69
  263.   float arg4; // [sp+F4h] [bp-320h]@71
  264.   float arg8; // [sp+F8h] [bp-31Ch]@71
  265.   float v263; // [sp+FCh] [bp-318h]@91
  266.   int v264; // [sp+104h] [bp-310h]@93
  267.   char v265; // [sp+108h] [bp-30Ch]@101
  268.   float v266; // [sp+110h] [bp-304h]@101
  269.   int v267; // [sp+114h] [bp-300h]@76
  270.   int v268; // [sp+118h] [bp-2FCh]@76
  271.   int v269; // [sp+11Ch] [bp-2F8h]@76
  272.   RwV3D a2; // [sp+120h] [bp-2F4h]@78
  273.   char v271; // [sp+12Fh] [bp-2E5h]@91
  274.   int v272; // [sp+130h] [bp-2E4h]@118
  275.   int v273; // [sp+134h] [bp-2E0h]@301
  276.   int v274; // [sp+138h] [bp-2DCh]@301
  277.   int v275; // [sp+13Ch] [bp-2D8h]@301
  278.   RwV3D v276; // [sp+140h] [bp-2D4h]@303
  279.   char v277; // [sp+14Fh] [bp-2C5h]@317
  280.   int v278; // [sp+150h] [bp-2C4h]@385
  281.   int v279; // [sp+154h] [bp-2C0h]@385
  282.   int v280; // [sp+158h] [bp-2BCh]@385
  283.   float v281; // [sp+15Ch] [bp-2B8h]@385
  284.   float v282; // [sp+160h] [bp-2B4h]@385
  285.   float v283; // [sp+164h] [bp-2B0h]@385
  286.   float v284; // [sp+168h] [bp-2ACh]@385
  287.   float v285; // [sp+16Ch] [bp-2A8h]@385
  288.   int v286; // [sp+170h] [bp-2A4h]@385
  289.   RwV3D a4; // [sp+174h] [bp-2A0h]@415
  290.   CColInfo vec1; // [sp+180h] [bp-294h]@415
  291.   RwV3D a6; // [sp+1A8h] [bp-26Ch]@415
  292.   int v290; // [sp+1B4h] [bp-260h]@564
  293.   float v291; // [sp+1B8h] [bp-25Ch]@622
  294.   float v292; // [sp+1BCh] [bp-258h]@622
  295.   float v293; // [sp+1C0h] [bp-254h]@622
  296.   RwV3D a1; // [sp+1C4h] [bp-250h]@71
  297.   char v295; // [sp+1D0h] [bp-244h]@75
  298.   float v296; // [sp+1DCh] [bp-238h]@75
  299.   float v297; // [sp+1E0h] [bp-234h]@75
  300.   char v298; // [sp+1E8h] [bp-22Ch]@76
  301.   int v299; // [sp+1ECh] [bp-228h]@76
  302.   char v300; // [sp+1F4h] [bp-220h]@78
  303.   float v301; // [sp+1F8h] [bp-21Ch]@78
  304.   float v302; // [sp+1FCh] [bp-218h]@78
  305.   int v303; // [sp+200h] [bp-214h]@78
  306.   char v304; // [sp+20Ch] [bp-208h]@79
  307.   int v305; // [sp+218h] [bp-1FCh]@79
  308.   char v306; // [sp+224h] [bp-1F0h]@84
  309.   char v307; // [sp+230h] [bp-1E4h]@86
  310.   char v308; // [sp+23Ch] [bp-1D8h]@89
  311.   char v309; // [sp+248h] [bp-1CCh]@90
  312.   char v310; // [sp+254h] [bp-1C0h]@98
  313.   int v311; // [sp+260h] [bp-1B4h]@98
  314.   char v312; // [sp+26Ch] [bp-1A8h]@99
  315.   int v313; // [sp+278h] [bp-19Ch]@99
  316.   char v314; // [sp+284h] [bp-190h]@100
  317.   int v315; // [sp+290h] [bp-184h]@100
  318.   RwV3D a3; // [sp+29Ch] [bp-178h]@101
  319.   char v317; // [sp+2A8h] [bp-16Ch]@289
  320.   char v318; // [sp+2B4h] [bp-160h]@294
  321.   char v319; // [sp+2C0h] [bp-154h]@300
  322.   char v320; // [sp+2CCh] [bp-148h]@301
  323.   int v321; // [sp+2D0h] [bp-144h]@301
  324.   char v322; // [sp+2D8h] [bp-13Ch]@303
  325.   float v323; // [sp+2DCh] [bp-138h]@303
  326.   float v324; // [sp+2E0h] [bp-134h]@303
  327.   int v325; // [sp+2E4h] [bp-130h]@303
  328.   char v326; // [sp+2F0h] [bp-124h]@304
  329.   int v327; // [sp+2FCh] [bp-118h]@304
  330.   char v328; // [sp+308h] [bp-10Ch]@310
  331.   char v329; // [sp+314h] [bp-100h]@312
  332.   char v330; // [sp+320h] [bp-F4h]@315
  333.   char v331; // [sp+32Ch] [bp-E8h]@316
  334.   char v332; // [sp+338h] [bp-DCh]@325
  335.   int v333; // [sp+344h] [bp-D0h]@325
  336.   char v334; // [sp+350h] [bp-C4h]@326
  337.   int v335; // [sp+35Ch] [bp-B8h]@326
  338.   char v336; // [sp+368h] [bp-ACh]@327
  339.   int v337; // [sp+374h] [bp-A0h]@327
  340.   char v338; // [sp+380h] [bp-94h]@328
  341.   int v339; // [sp+38Ch] [bp-88h]@328
  342.   int v340; // [sp+398h] [bp-7Ch]@335
  343.   int v341; // [sp+39Ch] [bp-78h]@335
  344.   int v342; // [sp+3A0h] [bp-74h]@335
  345.   float v343; // [sp+3A4h] [bp-70h]@350
  346.   float v344; // [sp+3A8h] [bp-6Ch]@350
  347.   float v345; // [sp+3B0h] [bp-64h]@351
  348.   float v346; // [sp+3B4h] [bp-60h]@351
  349.   char v347; // [sp+3BCh] [bp-58h]@385
  350.   float v348; // [sp+3C0h] [bp-54h]@385
  351.   float v349; // [sp+3C4h] [bp-50h]@385
  352.   char v350; // [sp+3C8h] [bp-4Ch]@385
  353.   float v351; // [sp+3CCh] [bp-48h]@385
  354.   int v352; // [sp+3D0h] [bp-44h]@385
  355.   int v353; // [sp+3D4h] [bp-40h]@416
  356.   int v354; // [sp+3D8h] [bp-3Ch]@416
  357.   int v355; // [sp+3DCh] [bp-38h]@416
  358.   int v356; // [sp+3E0h] [bp-34h]@417
  359.   int v357; // [sp+3E4h] [bp-30h]@417
  360.   int v358; // [sp+3E8h] [bp-2Ch]@417
  361.   char v359; // [sp+3ECh] [bp-28h]@445
  362.   char v360; // [sp+3F8h] [bp-1Ch]@564
  363.   float v361; // [sp+3FCh] [bp-18h]@564
  364.  
  365.   thiss = this;
  366.   if ( !byte_703899 )
  367.   {
  368.     byte_703899 = 1;
  369.     byte_703898 = 0;
  370.   }
  371.   v234 = 0;
  372.   v232 = 0;
  373.   v233 = 0;
  374.   v235 = this->cams[this->activeCam].field_C;
  375.   this->gap_5E[0] = 0;
  376.   this->gap_5E[1] = 0;
  377.   this->field_67 = 0;
  378.   this->field_66 = 0;
  379.   this->field_58 = 0;
  380.   this->gap_65[0] = 0;
  381.   this->field_52 = 0;
  382.   this->field_50 = 0;
  383.   byte_703684 = 0;
  384.   if ( !this->cams[this->activeCam].targetedEntity && !this->targetedEntity )
  385.     this->targetedEntity = (CEntity *)players[currentPlayer].pPed;
  386.   ++this->field_CC;
  387.   if ( this->field_CC > this->field_C8 )
  388.     this->field_CC = 1;
  389.   this->field_4E = this->field_CC == this->field_C8;
  390.   if ( this->field_4E == 1 )
  391.   {
  392.     if ( sub_57E1C0() )
  393.       thiss->field_73 = 1;
  394.     else
  395.       thiss->field_73 = 0;
  396.   }
  397.   if ( thiss->field_5B == 1 )
  398.   {
  399.     v2 = CPad__GetPad(0);
  400.     v2->flags &= 0xFFFEu;
  401.     v3 = FindPlayerPed();
  402.     v3->__parent.__parent.__parent.field_52 = v3->__parent.__parent.__parent.field_52 & 0xFB | 4;
  403.   }
  404.   if ( !menuFreeze && !dvdNotInDrive && !thiss->field_51 )
  405.   {
  406.     v239 = flt_68ADD8;
  407.     v240 = flt_68ADD8;
  408.     if ( thiss->field_64 == 1 )
  409.     {
  410.       v4 = (CAutomobile *)thiss->targetedEntity;
  411.       v5 = 0;
  412.       if ( (v4->__parent.__parent.__parent.flags & 7) != 2 || v4->__parent.vehicleType != 2 )
  413.         v5 = 1;
  414.       if ( v5 )
  415.       {
  416.         sub_46BC7D(thiss);
  417.         thiss->gap_65[0] = 1;
  418.         thiss->field_64 = 0;
  419.         CCamera__SetWideScreenOff(thiss);
  420.       }
  421.     }
  422.     v6 = thiss->targetedEntity;
  423.     v7 = v6->flags & 7;
  424.     if ( v7 == 2 )
  425.     {
  426.       if ( v6[6].placeable.matrix.matrixPtr == (RwMatrix *)1 && v6->modelIndex != 190 )
  427.         v233 = 1;
  428.       v8 = CPad__GetPad(0);
  429.       if ( (unsigned __int8)CPad__CycleCameraModeUpJustDown(v8) && byte_A10AF6 != 1 && (thiss->field_5B == 1 || thiss->field_D0 == 2) )
  430.       {
  431.         if ( !thiss->wideScreen )
  432.         {
  433.           thiss->field_DC = thiss->field_DC - dword_68AE2C;
  434.           if ( flt_68ADE8 != thiss->field_DC )
  435.             thiss->field_DC = thiss->field_DC - dword_68AE2C;
  436.         }
  437.       }
  438.       v9 = CPad__GetPad(0);
  439.       if ( (unsigned __int8)CPad__CycleCameraModeDownJustDown(v9) && byte_A10AF6 != 1 && (thiss->field_5B == 1 || thiss->field_D0 == 2) )
  440.       {
  441.         if ( !thiss->wideScreen )
  442.         {
  443.           thiss->field_DC = thiss->field_DC + dword_68AE2C;
  444.           if ( flt_68ADE8 != thiss->field_DC )
  445.             thiss->field_DC = thiss->field_DC + dword_68AE2C;
  446.         }
  447.       }
  448.       if ( !thiss->field_73 )
  449.       {
  450.         v10 = thiss->field_DC;
  451.         if ( v10 <= flt_68ADCC )
  452.         {
  453.           if ( v10 >= flt_68ADD8 )
  454.             LODWORD(thiss->field_DC) = 1084227584;
  455.         }
  456.         else
  457.         {
  458.           LODWORD(thiss->field_DC) = 0;
  459.         }
  460.       }
  461.       if ( thiss->field_73 )
  462.       {
  463.         v11 = thiss->field_DC;
  464.         if ( flt_68ADE8 == v11 )
  465.         {
  466.           if ( flt_68ADD8 == v11 )
  467.             word_70388A = 18;
  468.         }
  469.       }
  470.       v12 = thiss->targetedEntity;
  471.       v236 = v12[6].placeable.matrix.matrixPtr;
  472.       if ( v12[6].placeable.matrix.matrixPtr == (RwMatrix *)1 && v12->modelIndex == 190 )
  473.         v236 = 0;
  474.       if ( v236 && v236 != (RwMatrix *)5 )
  475.       {
  476.         if ( v236 == (RwMatrix *)1 )
  477.           word_70388A = 22;
  478. LABEL_118:
  479.         v47 = sub_5BAA80((CVehicle *)thiss->targetedEntity);
  480.         v272 = 0;
  481.         sub_46F659(v47, &v272);
  482.         v48 = thiss->field_DC;
  483.         if ( flt_68ADD8 != v48 && !thiss->field_56 )
  484.         {
  485.           *(_DWORD *)&thiss->gap_E0[0] = 0;
  486.           word_70388A = 16;
  487. LABEL_128:
  488.           if ( flt_68ADE8 != thiss->field_DC && !thiss->field_56 )
  489.           {
  490.             *(_DWORD *)&thiss->gap_E0[0] = 1065353216;
  491.             word_70388A = 1;
  492.           }
  493.           if ( !v236 )
  494.           {
  495.             if ( !thiss->field_56 )
  496.             {
  497.               v50 = *(float *)(sub_4739B2(pmodels[thiss->targetedEntity->modelIndex]) + 24);
  498.               v248 = *(float *)(sub_4739B2(pmodels[thiss->targetedEntity->modelIndex]) + 36) - v50;
  499.               if ( (unsigned __int8)sub_57E180() )
  500.               {
  501.                 if ( v248 >= (double)flt_68AF14 && !thiss->field_6F0 )
  502.                 {
  503.                   word_70388A = 16;
  504.                   thiss->field_52 = 1;
  505.                 }
  506.               }
  507.             }
  508.           }
  509.           if ( word_70388A == 1 && ((unsigned __int8)sub_57E180() || (unsigned __int8)CCullZones__CamNoRain(v52, v51) || CCullZones__PlayerNoRain()) )
  510.             word_70388A = 16;
  511.           v53 = thiss->field_69;
  512.           if ( v53 == 1 )
  513.           {
  514.             v54 = *(float *)&thiss->field_130;
  515.             v55 = *(float *)&thiss->field_E4;
  516.             if ( *(float *)&thiss->field_E4 < v54 )
  517.             {
  518.               v58 = v55 - flt_68AF18 * fGameEngineSpeed;
  519.               if ( v54 > v58 )
  520.                 v58 = *(float *)&thiss->field_130;
  521.               v57 = v58;
  522.             }
  523.             else
  524.             {
  525.               v56 = flt_68AF18 * fGameEngineSpeed + v55;
  526.               if ( v54 >= v56 )
  527.                 v56 = *(float *)&thiss->field_130;
  528.               v57 = v56;
  529.             }
  530.           }
  531.           else
  532.           {
  533.             if ( thiss->field_73 )
  534.             {
  535.               v239 = flt_68AF1C;
  536.               v59 = *(float *)&thiss->field_E4;
  537.               if ( *(float *)&thiss->field_E4 < (double)flt_68AF20 )
  538.               {
  539.                 v62 = v59 - flt_68AF18 * fGameEngineSpeed;
  540.                 if ( flt_68AF20 <= v62 )
  541.                   v63 = v62;
  542.                 else
  543.                   v63 = flt_68AF20;
  544.                 v57 = v63;
  545.               }
  546.               else
  547.               {
  548.                 v60 = flt_68AF18 * fGameEngineSpeed + v59;
  549.                 if ( flt_68AF20 < v60 )
  550.                   v61 = v60;
  551.                 else
  552.                   v61 = flt_68AF20;
  553.                 v57 = v61;
  554.               }
  555.             }
  556.             else
  557.             {
  558.               if ( v53 )
  559.                 goto LABEL_171;
  560.               v64 = *(float *)&thiss->gap_E0[0];
  561.               v65 = *(float *)&thiss->field_E4;
  562.               if ( *(float *)&thiss->field_E4 < v64 )
  563.               {
  564.                 v68 = v65 - flt_68AF18 * fGameEngineSpeed;
  565.                 if ( v64 > v68 )
  566.                   v68 = *(float *)&thiss->gap_E0[0];
  567.                 v67 = v68;
  568.               }
  569.               else
  570.               {
  571.                 v66 = flt_68AF18 * fGameEngineSpeed + v65;
  572.                 if ( v64 >= v66 )
  573.                   v66 = *(float *)&thiss->gap_E0[0];
  574.                 v67 = v66;
  575.               }
  576.               *(float *)&thiss->field_E4 = v67;
  577.               if ( flt_68ADF4 == thiss->field_DC || (v57 = *(float *)&thiss->gap_E0[0], flt_68ADD8 == v57) )
  578.                 goto LABEL_171;
  579.             }
  580.           }
  581.           *(float *)&thiss->field_E4 = v57;
  582. LABEL_171:
  583.           v69 = (char *)thiss + 460 * thiss->activeCam;
  584.           sub_4864E3(v239, (int)(v69 + 492), (int)(v69 + 496), flt_68AEB8, dword_68AF24, 0);
  585.           if ( (unsigned __int8)sub_485B17(&thiss->cams[thiss->activeCam].?camPos)
  586.             && !v233
  587.             && (thiss->cams[thiss->activeCam].targetedEntity->flags & 7) != 3
  588.             && thiss->targetedEntity->modelIndex != 190
  589.             && thiss->targetedEntity->modelIndex != 177 )
  590.             word_70388A = 23;
  591.           goto LABEL_420;
  592.         }
  593.         if ( dword_68AE2C == v48 )
  594.         {
  595.           if ( flt_68ADE4 == v48 )
  596.           {
  597.             if ( flt_68ADF4 == v48 )
  598.               goto LABEL_128;
  599.             v49 = flt_68AB98[v272];
  600.           }
  601.           else
  602.           {
  603.             v49 = flt_68AB84[v272];
  604.           }
  605.         }
  606.         else
  607.         {
  608.           v49 = flt_68AB70[v272];
  609.         }
  610.         *(float *)&thiss->gap_E0[0] = v49;
  611.         goto LABEL_128;
  612.       }
  613.       v13 = 0;
  614.       if ( v236 == (RwMatrix *)5 )
  615.       {
  616.         if ( (unsigned __int8)sub_57E1A0() )
  617.         {
  618.           v13 = sub_57E470();
  619.           if ( v13 )
  620.             v234 = 1;
  621.         }
  622.       }
  623.       v14 = Matrix__GetPos(&thiss->targetedEntity->placeable.matrix.__parent);
  624.       if ( !(unsigned __int8)CGarages__IsPointInAGarageCameraZone(*(_DWORD *)v14) && !v234 )
  625.       {
  626.         if ( thiss->field_56 )
  627.         {
  628.           thiss->field_58 = 1;
  629.           thiss->field_56 = 0;
  630.         }
  631.         thiss->cameraInFreeMode = 0;
  632.         goto LABEL_115;
  633.       }
  634.       if ( (thiss->cameraInFreeMode || thiss->field_5B != 1) && thiss->field_D0 != 2 || !thiss->field_6EC && !v13 )
  635.       {
  636. LABEL_102:
  637.         if ( ((unsigned __int8)CGarages__CameraShouldBeOutside() || v234)
  638.           && thiss->cameraInFreeMode == 1
  639.           && (thiss->field_5B == 1 || thiss->field_D0 == 2) )
  640.         {
  641.           if ( thiss->field_6EC || v13 )
  642.           {
  643.             word_70388A = 15;
  644.             thiss->field_56 = 1;
  645.           }
  646.           goto LABEL_118;
  647.         }
  648.         if ( thiss->field_56 )
  649.         {
  650.           thiss->field_58 = 1;
  651.           thiss->field_56 = 0;
  652.         }
  653. LABEL_115:
  654.         word_70388A = 18;
  655.         goto LABEL_118;
  656.       }
  657.       v15 = sub_423020(&thiss->targetedEntity->placeable);
  658.       sub_473A87((int)&v260, v15);
  659.       v16 = thiss->field_6EC;
  660.       if ( v16 )
  661.       {
  662.         if ( *(_DWORD *)(v16 + 12) )
  663.         {
  664.           v226 = 1;
  665.           arg8 = 0.0;
  666.           v255 = *(float *)(v16 + 92);
  667.           v17 = thiss->field_6EC;
  668.           v257 = 0.0;
  669.           v256 = *(float *)(v17 + 96);
  670.           v18 = 0.0 - 0.0;
  671.           v19 = arg4 - v256;
  672.           v20 = v260 - v255;
  673.           sub_473A6E(&a1, v20, v19, v18);
  674.           v21 = sub_473A4F(&a1);
  675.           sub_422FC0(v21);
  676.         }
  677.         else
  678.         {
  679.           if ( *(_DWORD *)(v16 + 16) )
  680.           {
  681.             v226 = 2;
  682.           }
  683.           else
  684.           {
  685.             v226 = 1;
  686.             v255 = *(float *)Matrix__GetPos(&thiss->targetedEntity->placeable.matrix.__parent);
  687.             v256 = *(float *)(Matrix__GetPos(&thiss->targetedEntity->placeable.matrix.__parent) + 4);
  688.             v259 = 0;
  689.           }
  690.         }
  691.       }
  692.       else
  693.       {
  694.         v226 = 1;
  695.         sub_473A87((int)&v255, (int)&thiss->cams[thiss->activeCam].?camPos);
  696.         v22 = (double)((*(_WORD *)(v13 + 4) + (signed int)*(_WORD *)(v13 + 6)) / 2);
  697.         v23 = (double)((*(_WORD *)v13 + (signed int)*(_WORD *)(v13 + 2)) / 2);
  698.         sub_473A6E(&v295, v23, v22, flt_68ADD8);
  699.         sub_473A87((int)&v252, (int)&v295);
  700.         v24 = v254 - v257;
  701.         v25 = v253 - v256;
  702.         v26 = v252 - v255;
  703.         sub_473A6E(&v296, v26, v25, v24);
  704.         v27 = v297 * v297 + v296 * v296;
  705.         v28 = sub_422FC0(v27);
  706.         if ( v28 > (double)flt_68AE28 )
  707.         {
  708.           v229 = 1;
  709.           v29 = sub_423020(&dword_7E4E94->__parent.__parent.placeable);
  710.           sub_473A1C(&v298, v29, &v252);
  711.           v267 = *(_DWORD *)&v298;
  712.           v268 = v299;
  713.           v269 = 0;
  714.           CVector__Normalise((int)&v267);
  715.           v30 = *(_WORD *)(v13 + 2) - *(_WORD *)v13;
  716.           if ( v30 <= *(_WORD *)(v13 + 6) - (signed int)*(_WORD *)(v13 + 4) )
  717.             v30 = *(_WORD *)(v13 + 6) - *(_WORD *)(v13 + 4);
  718.           v250 = (double)v30 * flt_68ADE4;
  719.           sub_4739E9((int)&v303, v250, (int)&v267);
  720.           v31 = sub_423020(&dword_7E4E94->__parent.__parent.placeable);
  721.           sub_4739B6(&v300, v31, &v303);
  722.           LODWORD(a2.x) = *(_DWORD *)&v300;
  723.           a2.y = v301;
  724.           a2.z = v302;
  725.           v32 = Matrix__GetPos(&dword_7E4E94->__parent.__parent.placeable.matrix.__parent);
  726.           if ( !CWorld__IsLineOfSightClear((RwV3D *)v32, &a2, 1, 0, 0, 0, 0, 0, 1) )
  727.           {
  728.             sub_4739E9((int)&v305, v250, (int)&v267);
  729.             v33 = sub_423020(&dword_7E4E94->__parent.__parent.placeable);
  730.             sub_473A1C(&v304, v33, &v305);
  731.             sub_473A87((int)&a2, (int)&v304);
  732.             v34 = Matrix__GetPos(&dword_7E4E94->__parent.__parent.placeable.matrix.__parent);
  733.             if ( !CWorld__IsLineOfSightClear((RwV3D *)v34, &a2, 1, 0, 0, 0, 0, 0, 1) )
  734.               v229 = 0;
  735.           }
  736.           if ( v229 )
  737.             sub_473A87((int)&v255, (int)&a2);
  738.         }
  739.       }
  740.       v35 = thiss->field_6EC;
  741.       if ( v35 )
  742.       {
  743.         v36 = (*(float *)(v35 + 76) + *(float *)(v35 + 80)) * flt_68AE08;
  744.         v37 = (*(float *)(v35 + 68) + *(float *)(v35 + 72)) * flt_68AE08;
  745.         sub_473A6E(&v306, v37, v36, flt_68ADD8);
  746.         v38 = &v306;
  747.       }
  748.       else
  749.       {
  750.         v257 = 0.0;
  751.         if ( v13 )
  752.         {
  753. LABEL_88:
  754.           if ( v226 == 1 )
  755.           {
  756.             sub_473A1C(&v308, &v255, &v252);
  757.             v42 = &v308;
  758.           }
  759.           else
  760.           {
  761.             sub_473A1C(&v309, &v258, &v252);
  762.             v42 = &v309;
  763.           }
  764.           sub_473A87((int)&v263, (int)v42);
  765.           v43 = sub_423020(&thiss->targetedEntity->placeable);
  766.           sub_473A87((int)&v260, v43);
  767.           v241 = CWorld__FindGroundZFor3DCoord(v260, arg4, arg8, (int)&v271);
  768.           if ( !v271 )
  769.             v241 = arg8 - flt_68AEBC;
  770.           v264 = 0;
  771.           CVector__Normalise((int)&v263);
  772.           if ( v226 == 1 )
  773.           {
  774.             if ( thiss->field_6EC || !v13 )
  775.             {
  776.               sub_4739E9((int)&v313, dword_68AF0C, (int)&v263);
  777.               sub_4739B6(&v312, &v255, &v313);
  778.               v46 = &v312;
  779.             }
  780.             else
  781.             {
  782.               v44 = *(_WORD *)(v13 + 2) - *(_WORD *)v13;
  783.               if ( v44 <= *(_WORD *)(v13 + 6) - (signed int)*(_WORD *)(v13 + 4) )
  784.                 v44 = *(_WORD *)(v13 + 6) - *(_WORD *)(v13 + 4);
  785.               v45 = (double)v44 * flt_68AF04 + flt_68AF08;
  786.               sub_4739E9((int)&v311, v45, (int)&v263);
  787.               sub_4739B6(&v310, &v252, &v311);
  788.               v46 = &v310;
  789.             }
  790.           }
  791.           else
  792.           {
  793.             sub_4739E9((int)&v315, dword_68AF0C, (int)&v263);
  794.             sub_4739B6(&v314, &v258, &v315);
  795.             v46 = &v314;
  796.           }
  797.           sub_473A87((int)&v265, (int)v46);
  798.           LODWORD(a3.x) = 0;
  799.           v266 = v241 + flt_68AF10;
  800.           LODWORD(a3.z) = 0;
  801.           LODWORD(a3.y) = 0;
  802.           CCamera__SetCamPositionForFixedMode(thiss, (RwV3D *)&v265, &a3);
  803.           thiss->cameraInFreeMode = 1;
  804.           goto LABEL_102;
  805.         }
  806.         v39 = flt_68ADD8;
  807.         LODWORD(v40) = *(_DWORD *)(sub_423020(&thiss->targetedEntity->placeable) + 4);
  808.         v41 = (float *)sub_423020(&thiss->targetedEntity->placeable);
  809.         sub_473A6E(&v307, *v41, v40, v39);
  810.         v38 = &v307;
  811.       }
  812.       sub_473A87((int)&v252, (int)v38);
  813.       goto LABEL_88;
  814.     }
  815.     if ( v7 != 3 )
  816.       goto LABEL_420;
  817.     v70 = CPad__GetPad(0);
  818.     if ( (unsigned __int8)CPad__CycleCameraModeUpJustDown(v70)
  819.       && byte_A10AF6 != 1
  820.       && (thiss->field_5B == 1 || thiss->field_D0 == 2)
  821.       && !thiss->wideScreen
  822.       && !thiss->field_73
  823.       && !thiss->gap_4F[0] )
  824.     {
  825.       if ( menu.standartControls )
  826.       {
  827.         thiss->field_164 = thiss->field_164 - dword_68AE2C;
  828.       }
  829.       else
  830.       {
  831.         if ( flt_68ADF4 == thiss->field_164 )
  832.           LODWORD(thiss->field_164) = 1077936128;
  833.         else
  834.           LODWORD(thiss->field_164) = 1065353216;
  835.       }
  836.     }
  837.     v71 = CPad__GetPad(0);
  838.     if ( (unsigned __int8)CPad__CycleCameraModeDownJustDown(v71)
  839.       && byte_A10AF6 != 1
  840.       && (thiss->field_5B == 1 || thiss->field_D0 == 2)
  841.       && !thiss->wideScreen
  842.       && !thiss->field_73
  843.       && !thiss->gap_4F[0] )
  844.     {
  845.       if ( menu.standartControls )
  846.       {
  847.         thiss->field_164 = thiss->field_164 + dword_68AE2C;
  848.       }
  849.       else
  850.       {
  851.         if ( flt_68ADF4 == thiss->field_164 )
  852.           LODWORD(thiss->field_164) = 1077936128;
  853.         else
  854.           LODWORD(thiss->field_164) = 1065353216;
  855.       }
  856.     }
  857.     v72 = thiss->field_164;
  858.     if ( v72 <= flt_68ADF4 )
  859.     {
  860.       if ( v72 >= dword_68AE2C )
  861.         LODWORD(thiss->field_164) = 1077936128;
  862.     }
  863.     else
  864.     {
  865.       LODWORD(thiss->field_164) = 1065353216;
  866.     }
  867.     word_70388A = 4;
  868.     if ( (thiss->field_5B == 1 || thiss->field_71)
  869.       && (dword_7E4E94->__parent.__parent.flags & 7) == 3
  870.       && (!thiss->wideScreen || thiss->field_71)
  871.       && !sub_4758B0((int)&unk_7E4810) )
  872.     {
  873.       v73 = CPad__GetPad(0);
  874.       if ( (unsigned __int16)sub_4A9A80(v73) || (v74 = CPad__GetPad(0), (unsigned __int16)CPad__LookAroundUpDown(v74)) )
  875.       {
  876.         *(_DWORD *)&thiss->gap_7C[0] = globalTimer;
  877.         thiss->gap_4F[0] = 1;
  878.       }
  879.       if ( !thiss->gap_4F[0] )
  880.       {
  881. LABEL_227:
  882.         v78 = (CPed *)FindPlayerPed();
  883.         if ( !CPed__IsPedInControl(v78) || FindPlayerPed()->walkSpeed > (double)flt_68ADD8 )
  884.           thiss->gap_4F[0] = 0;
  885.         if ( thiss->gap_4F[0] )
  886.         {
  887.           word_70388A = 16;
  888.           v79 = CPad__GetPad(0);
  889.           v79->flags |= 1u;
  890.         }
  891.         v80 = thiss->field_164;
  892.         if ( dword_68AE2C == v80 )
  893.         {
  894.           if ( flt_68ADE4 == v80 )
  895.           {
  896.             if ( flt_68ADF4 != v80 )
  897.               *(_DWORD *)&thiss->gap_140[4] = 1077516698;
  898.           }
  899.           else
  900.           {
  901.             *(_DWORD *)&thiss->gap_140[4] = 1069547520;
  902.           }
  903.         }
  904.         else
  905.         {
  906.           *(_DWORD *)&thiss->gap_140[4] = 1048576000;
  907.         }
  908.         v81 = thiss->field_68;
  909.         if ( v81 == 1 )
  910.         {
  911.           v82 = *(float *)&thiss->field_148;
  912.           v83 = *(float *)&thiss->field_14C;
  913.           if ( *(float *)&thiss->field_14C < v82 )
  914.           {
  915.             v86 = v83 - flt_68AF18 * fGameEngineSpeed;
  916.             if ( v82 > v86 )
  917.               v86 = *(float *)&thiss->field_148;
  918.             v85 = v86;
  919.           }
  920.           else
  921.           {
  922.             v84 = flt_68AF18 * fGameEngineSpeed + v83;
  923.             if ( v82 >= v84 )
  924.               v84 = *(float *)&thiss->field_148;
  925.             v85 = v84;
  926.           }
  927.         }
  928.         else
  929.         {
  930.           if ( thiss->field_73 )
  931.           {
  932.             if ( !byte_7038A0 )
  933.             {
  934.               byte_7038A0 = 1;
  935.               dword_70389C = 1056964608;
  936.             }
  937.             v240 = flt_68AF04;
  938.             v87 = *(float *)&thiss->field_14C;
  939.             if ( *(float *)&thiss->field_14C < (double)*(float *)&dword_70389C )
  940.             {
  941.               v90 = v87 - flt_68AF18 * fGameEngineSpeed;
  942.               if ( *(float *)&dword_70389C <= v90 )
  943.                 v91 = v90;
  944.               else
  945.                 v91 = *(float *)&dword_70389C;
  946.               v85 = v91;
  947.             }
  948.             else
  949.             {
  950.               v88 = flt_68AF18 * fGameEngineSpeed + v87;
  951.               if ( *(float *)&dword_70389C < v88 )
  952.                 v89 = v88;
  953.               else
  954.                 v89 = *(float *)&dword_70389C;
  955.               v85 = v89;
  956.             }
  957.           }
  958.           else
  959.           {
  960.             if ( v81 )
  961.               goto LABEL_269;
  962.             v92 = *(float *)&thiss->gap_140[4];
  963.             v93 = *(float *)&thiss->field_14C;
  964.             if ( *(float *)&thiss->field_14C < v92 )
  965.             {
  966.               v96 = v93 - flt_68AF18 * fGameEngineSpeed;
  967.               if ( v92 > v96 )
  968.                 v96 = *(float *)&thiss->gap_140[4];
  969.               v95 = v96;
  970.             }
  971.             else
  972.             {
  973.               v94 = flt_68AF18 * fGameEngineSpeed + v93;
  974.               if ( v92 >= v94 )
  975.                 v94 = *(float *)&thiss->gap_140[4];
  976.               v95 = v94;
  977.             }
  978.             *(float *)&thiss->field_14C = v95;
  979.             if ( flt_68ADF4 == thiss->field_164 || (v85 = *(float *)&thiss->gap_140[4], flt_68ADD8 == v85) )
  980.             {
  981. LABEL_269:
  982.               v97 = (char *)thiss + 460 * thiss->activeCam;
  983.               sub_4864E3(v240, (int)(v97 + 484), (int)(v97 + 488), flt_68AEB8, dword_68AF2C, 0);
  984.               if ( !thiss->gap_4F[0] )
  985.               {
  986.                 if ( FindPlayerPed()->__parent.actionState == 17 && !byte_A10B4C )
  987.                   word_70388A = 36;
  988.                 if ( *((_DWORD *)&dword_7E4E94[1].vehicleAI.field_40 + 6 * dword_7E4E94[1].field_248[28]) == 6
  989.                   && FindPlayerPed()->__parent.actionState == 16
  990.                   && !byte_A10B4C )
  991.                   word_70388A = 36;
  992.               }
  993.               v98 = 0;
  994.               if ( (unsigned __int8)sub_57E1A0() )
  995.               {
  996.                 v98 = sub_57E470();
  997.                 if ( v98 )
  998.                   v234 = 1;
  999.               }
  1000.               v99 = Matrix__GetPos(&thiss->targetedEntity->placeable.matrix.__parent);
  1001.               if ( (!(unsigned __int8)CGarages__IsPointInAGarageCameraZone(*(_DWORD *)v99) || byte_A10B4C) && !v234 )
  1002.               {
  1003.                 if ( thiss->field_56 )
  1004.                 {
  1005.                   thiss->field_58 = 1;
  1006.                   thiss->field_56 = 0;
  1007.                 }
  1008.                 thiss->cameraInFreeMode = 0;
  1009.                 goto LABEL_349;
  1010.               }
  1011.               if ( thiss->cameraInFreeMode || thiss->field_5B != 1 || (v100 = thiss->field_6EC) == 0 && !v234 )
  1012.               {
  1013. LABEL_336:
  1014.                 if ( ((unsigned __int8)CGarages__CameraShouldBeOutside() || v234) && thiss->field_5B == 1 && thiss->cameraInFreeMode == 1 )
  1015.                 {
  1016.                   if ( thiss->field_6EC || v234 )
  1017.                   {
  1018.                     word_70388A = 15;
  1019.                     thiss->field_56 = 1;
  1020.                   }
  1021.                 }
  1022.                 else
  1023.                 {
  1024.                   if ( thiss->field_56 )
  1025.                   {
  1026.                     thiss->field_58 = 1;
  1027.                     thiss->field_56 = 0;
  1028.                   }
  1029.                   word_70388A = 4;
  1030.                 }
  1031. LABEL_349:
  1032.                 if ( !thiss->gap_4F[0] )
  1033.                 {
  1034.                   v132 = Matrix__GetPos(&thiss->targetedEntity->placeable.matrix.__parent);
  1035.                   v133 = *(float *)(v132 + 8) - flt_68ADD8;
  1036.                   v134 = *(float *)(v132 + 4) - flt_68AF58;
  1037.                   v135 = *(float *)v132 - flt_68AF5C;
  1038.                   sub_473A6E(&v343, v135, v134, v133);
  1039.                   v136 = v344 * v344 + v343 * v343;
  1040.                   v137 = sub_422FC0(v136);
  1041.                   if ( v137 >= (double)flt_68AE1C )
  1042.                   {
  1043.                     v138 = Matrix__GetPos(&thiss->targetedEntity->placeable.matrix.__parent);
  1044.                     v139 = *(float *)(v138 + 8) - flt_68ADD8;
  1045.                     v140 = *(float *)(v138 + 4) - flt_68AF58;
  1046.                     v141 = *(float *)v138 - flt_68AF5C;
  1047.                     sub_473A6E(&v345, v141, v140, v139);
  1048.                     v142 = v346 * v346 + v345 * v345;
  1049.                     v143 = sub_422FC0(v142);
  1050.                     if ( v143 >= (double)flt_68AF60
  1051.                       || *(float *)(Matrix__GetPos(&thiss->targetedEntity->placeable.matrix.__parent) + 8) > (double)flt_68AE44 )
  1052.                     {
  1053.                       if ( !sub_4758B0((int)&thiss->cams[thiss->activeCam]) )
  1054.                         word_70388A = 38;
  1055.                     }
  1056.                   }
  1057.                 }
  1058.                 if ( (unsigned __int8)sub_485B17(&thiss->cams[thiss->activeCam].?camPos)
  1059.                   && (thiss->cams[thiss->activeCam].targetedEntity->flags & 7) == 3 )
  1060.                   word_70388A = 23;
  1061.                 if ( flt_68ADE8 != thiss->field_164
  1062.                   && !(unsigned __int8)sub_57E180()
  1063.                   && !(unsigned __int8)CCullZones__CamNoRain(v145, v144)
  1064.                   && !CCullZones__PlayerNoRain()
  1065.                   && !thiss->gap_4F[0]
  1066.                   && !thiss->field_56 )
  1067.                   word_70388A = 37;
  1068.                 v146 = CPad__GetPad(0);
  1069.                 if ( !CPad__GetTarget(v146) && LOWORD(thiss->field_700) != 45 )
  1070.                   sub_46FE51(thiss);
  1071.                 if ( *(_WORD *)&thiss->gap_6F4[0] )
  1072.                   word_70388A = *(_WORD *)&thiss->gap_6F4[0];
  1073.                 v147 = LOWORD(thiss->field_700);
  1074.                 if ( v147 && !v234 )
  1075.                 {
  1076.                   if ( v147 == 34
  1077.                     || (unsigned __int16)(v147 - 7) <= 2u
  1078.                     || (unsigned __int16)(v147 - 45) <= 1u
  1079.                     || (unsigned __int8)sub_485D78(&thiss->cams[thiss->activeCam]) )
  1080.                   {
  1081.                     if ( players[currentPlayer].pPed->__parent.actionState != 24
  1082.                       || word_70388A == 37
  1083.                       || (unsigned __int8)sub_485D78(&thiss->cams[thiss->activeCam]) )
  1084.                       word_70388A = LOWORD(thiss->field_700);
  1085.                     else
  1086.                       word_70388A = 4;
  1087.                   }
  1088.                   else
  1089.                   {
  1090.                     if ( word_70388A != 37 && flt_68ADF4 == flt_7E47EC )
  1091.                     {
  1092.                       v243 = flt_68ADE8;
  1093.                       if ( !byte_7038A8 )
  1094.                       {
  1095.                         byte_7038A8 = 1;
  1096.                         dword_7038A4 = 1073741824;
  1097.                       }
  1098.                       v225 = 0;
  1099.                       v148 = sub_423020(&thiss->targetedEntity->placeable);
  1100.                       v278 = *(_DWORD *)v148;
  1101.                       v279 = *(_DWORD *)(v148 + 4);
  1102.                       v280 = *(_DWORD *)(v148 + 8);
  1103.                       sub_473A1C(&v347, &thiss->field_724, &v278);
  1104.                       LODWORD(v281) = *(_DWORD *)&v347;
  1105.                       v282 = v348;
  1106.                       v283 = v349;
  1107.                       sub_473A1C(&v350, &thiss->cams[thiss->activeCam].?camPos, &v278);
  1108.                       LODWORD(v284) = *(_DWORD *)&v350;
  1109.                       v285 = v351;
  1110.                       v286 = v352;
  1111.                       if ( dword_68AE2C != thiss->field_164 )
  1112.                         v243 = flt_68AF64;
  1113.                       if ( FindPlayerPed()->__parent.objectiveTarget )
  1114.                       {
  1115.                         if ( *(_DWORD *)&FindPlayerPed()->__parent.objectiveTarget[5].flags != 55
  1116.                           && *(_DWORD *)&FindPlayerPed()->__parent.objectiveTarget[5].flags != 54 )
  1117.                         {
  1118.                           v246 = *(float *)&dword_7038A4;
  1119.                         }
  1120.                         else
  1121.                         {
  1122.                           v225 = 1;
  1123.                           v246 = v243;
  1124.                         }
  1125.                         v149 = v282;
  1126.                         v150 = v282 * v282 + v281 * v281;
  1127.                         v151 = sqrt__(v150);
  1128.                         v152 = v285;
  1129.                         v249 = v151;
  1130.                         v153 = v284 * v284;
  1131.                         v154 = v285 * v285 + v153;
  1132.                         sqrt__(v154);
  1133.                         v245 = CGeneral__GetATanOfXY(v284, v152);
  1134.                         v244 = CGeneral__GetATanOfXY(v281, v149);
  1135.                         word_70388A = LOWORD(thiss->field_700);
  1136.                         if ( thiss->cams[thiss->activeCam].field_C != 11 )
  1137.                         {
  1138.                           v153 = v245 - v244;
  1139.                           for ( i = v153; i >= flt_68AE70; i = i - flt_68AE74 )
  1140.                             ;
  1141.                           while ( i >= flt_68AE78 )
  1142.                             i = i + flt_68AE74;
  1143.                           v156 = i;
  1144.                           v157 = fabs__(v156);
  1145.                           if ( v157 >= (double)flt_68AE68 )
  1146.                           {
  1147.                             if ( v249 >= (double)flt_68AE20 && v283 > (double)flt_68AED8 )
  1148.                               word_70388A = 28;
  1149.                           }
  1150.                         }
  1151.                         v158 = flt_68ADD8;
  1152.                         v247 = flt_68ADD8;
  1153.                         if ( word_70388A == 28 || word_70388A == 11 )
  1154.                         {
  1155.                           if ( !byte_7E4711 || thiss->cams[thiss->activeCam].field_C == 35 )
  1156.                           {
  1157.                             v158 = v249;
  1158.                             if ( v249 >= (double)v246 )
  1159.                             {
  1160.                               if ( v225 )
  1161.                               {
  1162.                                 if ( word_70388A == 28 )
  1163.                                   v158 = flt_68ADCC;
  1164.                                 else
  1165.                                   v158 = flt_68AF68;
  1166.                                 v247 = v158;
  1167.                                 word_70388A = 35;
  1168.                               }
  1169.                             }
  1170.                           }
  1171.                         }
  1172.                         if ( word_70388A == 35 )
  1173.                         {
  1174.                           if ( !byte_703898 )
  1175.                           {
  1176.                             sub_4230E0(&vec1, v222);
  1177.                             sub_4230E0(&vec1.normal, v159);
  1178.                             LODWORD(a6.x) = 0;
  1179.                             v160 = sub_423020(&thiss->targetedEntity->placeable);
  1180.                             sub_473A87((int)&a4, v160);
  1181.                             sub_423BA0(v245);
  1182.                             v161 = v153;
  1183.                             a4.x = v247 * v161 + a4.x;
  1184.                             sub_423B70(v245);
  1185.                             v162 = v158;
  1186.                             a4.y = v247 * v162 + a4.y;
  1187.                             a4.z = a4.z + flt_68AF6C;
  1188.                             v163 = Matrix__GetPos(&thiss->targetedEntity->placeable.matrix.__parent);
  1189.                             if ( CWorld__ProcessLineOfSight((RwV3D *)v163, &a4, &vec1, (CEntity **)&a6, 1, 0, 0, 1, 0, 1, 1, 0) )
  1190.                             {
  1191.                               v353 = 0;
  1192.                               v164 = (RwV3D *)&vec1;
  1193.                               v354 = 0;
  1194.                               v220 = &v353;
  1195.                               v355 = 0;
  1196.                             }
  1197.                             else
  1198.                             {
  1199.                               v356 = 0;
  1200.                               v164 = &a4;
  1201.                               v357 = 0;
  1202.                               v220 = &v356;
  1203.                               v358 = 0;
  1204.                             }
  1205.                             CCamera__SetCamPositionForFixedMode(thiss, v164, (RwV3D *)v220);
  1206.                             byte_703898 = 1;
  1207.                           }
  1208.                         }
  1209.                         else
  1210.                         {
  1211.                           byte_703898 = 0;
  1212.                         }
  1213.                       }
  1214.                     }
  1215.                   }
  1216.                 }
  1217.                 goto LABEL_420;
  1218.               }
  1219.               if ( v100 )
  1220.               {
  1221.                 v101 = sub_423020(&thiss->targetedEntity->placeable);
  1222.                 sub_473A87((int)&v260, v101);
  1223.                 v102 = thiss->field_6EC;
  1224.                 if ( *(_DWORD *)(v102 + 12) )
  1225.                 {
  1226.                   v227 = 1;
  1227.                   arg8 = 0.0;
  1228.                   v255 = *(float *)(v102 + 92);
  1229.                   v103 = thiss->field_6EC;
  1230.                   v257 = 0.0;
  1231.                   v256 = *(float *)(v103 + 96);
  1232.                   v104 = 0.0 - 0.0;
  1233.                   v105 = arg4 - v256;
  1234.                   v106 = v260 - v255;
  1235.                   sub_473A6E(&v317, v106, v105, v104);
  1236.                   v107 = sub_473A4F((RwV3D *)&v317);
  1237.                   sub_422FC0(v107);
  1238.                 }
  1239.                 else
  1240.                 {
  1241.                   if ( *(_DWORD *)(v102 + 16) )
  1242.                   {
  1243.                     v227 = 2;
  1244.                   }
  1245.                   else
  1246.                   {
  1247.                     v227 = 1;
  1248.                     v255 = *(float *)Matrix__GetPos(&thiss->targetedEntity->placeable.matrix.__parent);
  1249.                     v256 = *(float *)(Matrix__GetPos(&thiss->targetedEntity->placeable.matrix.__parent) + 4);
  1250.                     v259 = 0;
  1251.                   }
  1252.                 }
  1253.                 goto LABEL_309;
  1254.               }
  1255.               v227 = 1;
  1256.               sub_473A87((int)&v255, (int)&thiss->cams[thiss->activeCam].?camPos);
  1257.               if ( !v98 )
  1258.                 goto LABEL_309;
  1259.               v108 = (double)((*(_WORD *)(v98 + 4) + (signed int)*(_WORD *)(v98 + 6)) / 2);
  1260.               v109 = (double)((*(_WORD *)v98 + (signed int)*(_WORD *)(v98 + 2)) / 2);
  1261.               sub_473A6E(&v318, v109, v108, flt_68ADD8);
  1262.               sub_473A87((int)&v252, (int)&v318);
  1263.               if ( *(float *)Matrix__GetPos(&dword_7E4E94->__parent.__parent.placeable.matrix.__parent) <= (double)flt_68AF30
  1264.                 || *(float *)Matrix__GetPos(&dword_7E4E94->__parent.__parent.placeable.matrix.__parent) < (double)flt_68AF34
  1265.                 || *(float *)(Matrix__GetPos(&dword_7E4E94->__parent.__parent.placeable.matrix.__parent) + 4) <= (double)flt_68AF38
  1266.                 || *(float *)(Matrix__GetPos(&dword_7E4E94->__parent.__parent.placeable.matrix.__parent) + 4) < (double)flt_68AF3C
  1267.                 || *(float *)(Matrix__GetPos(&dword_7E4E94->__parent.__parent.placeable.matrix.__parent) + 8) <= (double)flt_68AF40
  1268.                 || *(float *)(Matrix__GetPos(&dword_7E4E94->__parent.__parent.placeable.matrix.__parent) + 8) < (double)flt_68AF44 )
  1269.               {
  1270.                 v230 = 1;
  1271.                 v111 = sub_423020(&dword_7E4E94->__parent.__parent.placeable);
  1272.                 sub_473A1C(&v320, v111, &v252);
  1273.                 v273 = *(_DWORD *)&v320;
  1274.                 v274 = v321;
  1275.                 v275 = 0;
  1276.                 CVector__Normalise((int)&v273);
  1277.                 v112 = *(_WORD *)(v98 + 2) - *(_WORD *)v98;
  1278.                 if ( v112 <= *(_WORD *)(v98 + 6) - (signed int)*(_WORD *)(v98 + 4) )
  1279.                   v112 = *(_WORD *)(v98 + 6) - *(_WORD *)(v98 + 4);
  1280.                 v251 = (double)v112 * flt_68ADE4;
  1281.                 sub_4739E9((int)&v325, v251, (int)&v273);
  1282.                 v113 = sub_423020(&dword_7E4E94->__parent.__parent.placeable);
  1283.                 sub_4739B6(&v322, v113, &v325);
  1284.                 LODWORD(v276.x) = *(_DWORD *)&v322;
  1285.                 v276.y = v323;
  1286.                 v276.z = v324;
  1287.                 v114 = Matrix__GetPos(&dword_7E4E94->__parent.__parent.placeable.matrix.__parent);
  1288.                 if ( !CWorld__IsLineOfSightClear((RwV3D *)v114, &v276, 1, 0, 0, 0, 0, 0, 1) )
  1289.                 {
  1290.                   sub_4739E9((int)&v327, v251, (int)&v273);
  1291.                   v115 = sub_423020(&dword_7E4E94->__parent.__parent.placeable);
  1292.                   sub_473A1C(&v326, v115, &v327);
  1293.                   sub_473A87((int)&v276, (int)&v326);
  1294.                   v116 = Matrix__GetPos(&dword_7E4E94->__parent.__parent.placeable.matrix.__parent);
  1295.                   if ( !CWorld__IsLineOfSightClear((RwV3D *)v116, &v276, 1, 0, 0, 0, 0, 0, 1) )
  1296.                     v230 = 0;
  1297.                 }
  1298.                 if ( !v230 )
  1299.                 {
  1300. LABEL_309:
  1301.                   v117 = thiss->field_6EC;
  1302.                   if ( v117 )
  1303.                   {
  1304.                     v118 = (*(float *)(v117 + 76) + *(float *)(v117 + 80)) * flt_68AE08;
  1305.                     v119 = (*(float *)(v117 + 68) + *(float *)(v117 + 72)) * flt_68AE08;
  1306.                     sub_473A6E(&v328, v119, v118, flt_68ADD8);
  1307.                     v120 = &v328;
  1308.                   }
  1309.                   else
  1310.                   {
  1311.                     v257 = 0.0;
  1312.                     if ( v98 )
  1313.                     {
  1314. LABEL_314:
  1315.                       if ( v227 == 1 )
  1316.                       {
  1317.                         sub_473A1C(&v330, &v255, &v252);
  1318.                         v124 = &v330;
  1319.                       }
  1320.                       else
  1321.                       {
  1322.                         sub_473A1C(&v331, &v258, &v252);
  1323.                         v124 = &v331;
  1324.                       }
  1325.                       sub_473A87((int)&v263, (int)v124);
  1326.                       v125 = sub_423020(&thiss->targetedEntity->placeable);
  1327.                       sub_473A87((int)&v260, v125);
  1328.                       v242 = CWorld__FindGroundZFor3DCoord(v260, arg4, arg8, (int)&v277);
  1329.                       if ( !v277 )
  1330.                         v242 = arg8 - flt_68AEBC;
  1331.                       v264 = 0;
  1332.                       if ( v227 == 1 )
  1333.                       {
  1334.                         if ( thiss->field_6EC || !v234 )
  1335.                         {
  1336.                           CVector__Normalise((int)&v263);
  1337.                           sub_4739E9((int)&v337, dword_68AF0C, (int)&v263);
  1338.                           sub_4739B6(&v336, &v255, &v337);
  1339.                           v128 = &v336;
  1340.                         }
  1341.                         else
  1342.                         {
  1343.                           CVector__Normalise((int)&v263);
  1344.                           if ( v98 )
  1345.                           {
  1346.                             v126 = *(_WORD *)(v98 + 2) - *(_WORD *)v98;
  1347.                             if ( v126 <= *(_WORD *)(v98 + 6) - (signed int)*(_WORD *)(v98 + 4) )
  1348.                               v126 = *(_WORD *)(v98 + 6) - *(_WORD *)(v98 + 4);
  1349.                             v127 = (double)v126 * flt_68AF04 + flt_68AF08;
  1350.                             sub_4739E9((int)&v333, v127, (int)&v263);
  1351.                             sub_4739B6(&v332, &v252, &v333);
  1352.                             v128 = &v332;
  1353.                           }
  1354.                           else
  1355.                           {
  1356.                             sub_4739E9((int)&v335, flt_68AF08, (int)&v263);
  1357.                             sub_4739B6(&v334, &v255, &v335);
  1358.                             v128 = &v334;
  1359.                           }
  1360.                         }
  1361.                       }
  1362.                       else
  1363.                       {
  1364.                         CVector__Normalise((int)&v263);
  1365.                         sub_4739E9((int)&v339, dword_68AF0C, (int)&v263);
  1366.                         sub_4739B6(&v338, &v258, &v339);
  1367.                         v128 = &v338;
  1368.                       }
  1369.                       sub_473A87((int)&v265, (int)v128);
  1370.                       if ( flt_68ADE8 == thiss->field_164 || v234 )
  1371.                       {
  1372.                         v266 = v242 + flt_68AF10;
  1373.                       }
  1374.                       else
  1375.                       {
  1376.                         sub_473A87((int)&v265, (int)&v252);
  1377.                         v129 = FindPlayerPed();
  1378.                         v130 = Matrix__GetPos(&v129->__parent.__parent.__parent.placeable.matrix.__parent);
  1379.                         v266 = flt_68AF54 + *(float *)(v130 + 8) + v266;
  1380.                         v131 = thiss->field_6EC;
  1381.                         if ( v131 && v266 > (double)*(float *)(v131 + 72) )
  1382.                           v266 = *(float *)(v131 + 72);
  1383.                       }
  1384.                       v340 = 0;
  1385.                       v342 = 0;
  1386.                       v341 = 0;
  1387.                       CCamera__SetCamPositionForFixedMode(thiss, (RwV3D *)&v265, (RwV3D *)&v340);
  1388.                       thiss->cameraInFreeMode = 1;
  1389.                       goto LABEL_336;
  1390.                     }
  1391.                     v121 = flt_68ADD8;
  1392.                     LODWORD(v122) = *(_DWORD *)(sub_423020(&thiss->targetedEntity->placeable) + 4);
  1393.                     v123 = (float *)sub_423020(&thiss->targetedEntity->placeable);
  1394.                     sub_473A6E(&v329, *v123, v122, v121);
  1395.                     v120 = &v329;
  1396.                   }
  1397.                   sub_473A87((int)&v252, (int)v120);
  1398.                   goto LABEL_314;
  1399.                 }
  1400.                 v110 = (int)&v276;
  1401.               }
  1402.               else
  1403.               {
  1404.                 sub_473A6E(&v319, dword_68AF50, dword_68AF4C, dword_68AF48);
  1405.                 v110 = (int)&v319;
  1406.               }
  1407.               sub_473A87((int)&v255, v110);
  1408.               goto LABEL_309;
  1409.             }
  1410.           }
  1411.         }
  1412.         *(float *)&thiss->field_14C = v85;
  1413.         goto LABEL_269;
  1414.       }
  1415.       v75 = CPad__GetPad(0);
  1416.       if ( !sub_4AAE30(v75) )
  1417.       {
  1418.         v76 = CPad__GetPad(0);
  1419.         if ( !CPad__GetPedWalkLeftRight(v76) )
  1420.         {
  1421.           if ( !CPad__GetPad(0)->activePadState.Button14
  1422.             && !CPad__GetPad(0)->activePadState.Button15
  1423.             && !CPad__GetPad(0)->activePadState.Button16
  1424.             && !CPad__GetPad(0)->activePadState.Button17
  1425.             && !CPad__GetPad(0)->activePadState.Button13
  1426.             && (double)(globalTimer - *(_DWORD *)&thiss->gap_7C[0]) <= flt_68AF28 )
  1427.           {
  1428.             v77 = CPad__GetPad(0);
  1429.             if ( (unsigned __int8)CPad__TargetJustDown(v77) )
  1430.             {
  1431.               thiss->gap_4F[0] = 0;
  1432.               thiss->field_50 = 1;
  1433.             }
  1434.             goto LABEL_227;
  1435.           }
  1436.         }
  1437.       }
  1438.     }
  1439.     thiss->gap_4F[0] = 0;
  1440.     goto LABEL_227;
  1441.   }
  1442. LABEL_420:
  1443.   if ( word_A10AB0 )
  1444.     word_70388A = word_A10AB0;
  1445.   v165 = 0;
  1446.   if ( !byte_7038AA )
  1447.   {
  1448.     byte_7038AA = 1;
  1449.     byte_7038A9 = 0;
  1450.   }
  1451.   v237 = 0;
  1452.   v166 = players[currentPlayer].pPed;
  1453.   if ( v166->__parent.actionState == 62 )
  1454.   {
  1455.     byte_7038A9 = 1;
  1456.   }
  1457.   else
  1458.   {
  1459.     if ( byte_7038A9 )
  1460.     {
  1461.       v237 = 1;
  1462.       byte_7038A9 = 0;
  1463.     }
  1464.   }
  1465.   if ( dword_703890 == 62 || v166->__parent.actionState != 62 )
  1466.   {
  1467.     v165 = 0;
  1468.   }
  1469.   else
  1470.   {
  1471.     if ( flt_68ADD8 == thiss->field_DC || (thiss->targetedEntity->flags & 7) != 2 )
  1472.       v165 = 1;
  1473.   }
  1474.   dword_703890 = v166->__parent.actionState;
  1475.   if ( v165 == 1 )
  1476.   {
  1477.     dword_703894 = 32;
  1478.     word_70388A = 32;
  1479.     thiss->cams[thiss->activeCam].field_A = 1;
  1480.   }
  1481.   else
  1482.   {
  1483.     if ( v166->__parent.actionState == 62 )
  1484.       word_70388A = dword_703894;
  1485.   }
  1486.   if ( players[currentPlayer].pPed->__parent.actionState == 55 )
  1487.   {
  1488.     if ( thiss->cams[thiss->activeCam].field_C == 29 )
  1489.     {
  1490.       word_70388A = 29;
  1491.     }
  1492.     else
  1493.     {
  1494.       v231 = 0;
  1495.       v167 = thiss->targetedEntity;
  1496.       if ( (v167->flags & 7) == 3 )
  1497.       {
  1498.         for ( j = 0; j < SLOWORD(v167[14].placeable.matrix.__parent.top.z); ++j )
  1499.         {
  1500.           v169 = *((_DWORD *)&v167[13].field_58 + j);
  1501.           if ( v169 )
  1502.           {
  1503.             if ( *(_DWORD *)(v169 + 580) == 49 )
  1504.             {
  1505.               v170 = Matrix__GetPos(&v167->placeable.matrix.__parent);
  1506.               v171 = Matrix__GetPos((RwMatrix *)(*((_DWORD *)&v167[13].field_58 + j) + 4));
  1507.               v172 = *(float *)(v171 + 8) - *(float *)(v170 + 8);
  1508.               v173 = *(float *)(v171 + 4) - *(float *)(v170 + 4);
  1509.               v174 = *(float *)v171 - *(float *)v170;
  1510.               sub_473A6E(&v359, v174, v173, v172);
  1511.               v175 = sub_473A4F((RwV3D *)&v359);
  1512.               v176 = sub_422FC0(v175);
  1513.               if ( v176 >= (double)flt_68ADE8 )
  1514.               {
  1515.                 word_70388A = 32;
  1516.                 v231 = 1;
  1517.                 thiss->cams[thiss->activeCam].field_A = 1;
  1518.                 break;
  1519.               }
  1520.             }
  1521.           }
  1522.         }
  1523.       }
  1524.       if ( !v231 )
  1525.       {
  1526.         word_70388A = 29;
  1527.         thiss->cams[thiss->activeCam].field_A = 1;
  1528.       }
  1529.     }
  1530.   }
  1531.   if ( thiss->field_60 == 1 )
  1532.   {
  1533.     if ( (unsigned __int16)(word_70388A - 7) > 1u
  1534.       && word_70388A != 46
  1535.       && word_70388A != 11
  1536.       && word_70388A != 28
  1537.       && (unsigned __int16)(word_70388A - 34) > 1u
  1538.       && word_70388A != 18
  1539.       && (unsigned __int16)(word_70388A - 3) > 1u
  1540.       && !byte_A10B4C )
  1541.       CCamera__SetBehindPlayer(&camera);
  1542.     word_70388A = thiss->field_948;
  1543.     thiss->cams[thiss->activeCam].field_C = word_70388A;
  1544.     byte_7E46E2 = 1;
  1545.     thiss->cams[thiss->activeCam].field_A = 1;
  1546.     sub_473A87((int)&thiss->cams[thiss->activeCam].gap_FC[48], (int)&flt_7E4DB8);
  1547.     thiss->cams[thiss->activeCam].targetedEntity = (CEntity *)dword_7E4E94;
  1548.     sub_473A87((int)&thiss->cams[thiss->activeCam].gap_FC[60], (int)&stru_7E4DC4);
  1549.     sub_473A87((int)&thiss->cams[thiss->activeCam].gap_FC[72], (int)&dword_7E4DD0);
  1550.     thiss->cams[thiss->activeCam].field_2 = 0;
  1551.     sub_473A87((int)&thiss->cams[thiss->activeCam].gap_FC[84], (int)&thiss->cams[(thiss->activeCam + 1) % 2].gap_FC[84]);
  1552.     thiss->field_60 = 0;
  1553.     thiss->cams[thiss->activeCam].field_A = 1;
  1554.     CEntity__RegisterReference(&dword_7E4E94->__parent.__parent, &dword_7E4E94);
  1555.     CEntity__RegisterReference(thiss->cams[thiss->activeCam].targetedEntity, &thiss->cams[thiss->activeCam].targetedEntity);
  1556.     *(float *)&thiss->field_E4 = *(float *)&thiss->gap_E0[0];
  1557.     *(float *)&thiss->field_14C = *(float *)&thiss->gap_140[4];
  1558.     thiss->field_89 = 0;
  1559.     thiss->field_869 = 0;
  1560.   }
  1561.   if ( byte_A10B4F )
  1562.     word_70388A = 9;
  1563.   v238 = 1;
  1564.   v177 = thiss->targetedEntity;
  1565.   if ( v177 )
  1566.   {
  1567.     if ( (v177->flags & 7) == 2 )
  1568.     {
  1569.       if ( flt_68ADCC != thiss->field_DC )
  1570.         thiss->gap_5E[1] = 1;
  1571.     }
  1572.     else
  1573.     {
  1574.       if ( flt_68ADCC != thiss->field_164 )
  1575.         thiss->gap_5E[0] = 1;
  1576.     }
  1577.   }
  1578.   if ( thiss->field_64 == 1
  1579.     || (unsigned __int16)(word_70388A - 28) <= 1u
  1580.     || word_70388A == 11
  1581.     || (unsigned __int16)(word_70388A - 7) <= 1u
  1582.     || word_70388A == 23
  1583.     || (unsigned __int16)(word_70388A - 32) <= 4u
  1584.     || (unsigned __int16)(word_70388A - 39) <= 4u
  1585.     || (unsigned __int16)(word_70388A - 45) <= 1u
  1586.     || thiss->field_D0 == 1
  1587.     || thiss->field_58
  1588.     || thiss->field_56 )
  1589.     v238 = 0;
  1590.   if ( thiss->gap_5E[0] && v238 == 1 )
  1591.   {
  1592.     v178 = sub_46BE18(thiss);
  1593.   }
  1594.   else
  1595.   {
  1596.     v179 = thiss->gap_5E[1];
  1597.     if ( v179 && v238 == 1 )
  1598.     {
  1599.       v180 = thiss->targetedEntity;
  1600.       if ( (v180->flags & 7) != 2 || sub_5BAA80((CVehicle *)v180) != 3 && thiss->targetedEntity[6].placeable.matrix.matrixPtr != (RwMatrix *)1 )
  1601.         v178 = sub_46BFEE(thiss);
  1602.       else
  1603.         v178 = sub_46BEE6(thiss);
  1604.     }
  1605.     else
  1606.     {
  1607.       if ( thiss->field_56 && v179 )
  1608.         v232 = 1;
  1609.       v238 = 0;
  1610.       v178 = sub_46FE13(thiss);
  1611.     }
  1612.   }
  1613.   if ( thiss->field_5B == 1 )
  1614.   {
  1615.     if ( word_70388A != 1 && word_70388A != 16 && word_70388A != 37 )
  1616.     {
  1617.       if ( word_70388A != 18 && word_70388A != 22 )
  1618.       {
  1619.         if ( word_70388A != 15 || thiss->cams[thiss->activeCam].field_C != 1 )
  1620.         {
  1621. LABEL_509:
  1622.           if ( word_70388A == 11 || word_70388A == 28 )
  1623.             v232 = 1;
  1624.           if ( word_70388A == 1 )
  1625.           {
  1626.             v181 = thiss->cams[thiss->activeCam].field_C;
  1627.             if ( v181 != 37 && v181 != 29 )
  1628.               goto LABEL_520;
  1629.           }
  1630.           else
  1631.           {
  1632.             if ( word_70388A != 37 || (v182 = thiss->cams[thiss->activeCam].field_C, v182 != 1) && v182 != 29 )
  1633.               goto LABEL_520;
  1634.           }
  1635.           v232 = 0;
  1636. LABEL_520:
  1637.           if ( (word_70388A == 16
  1638.              || (unsigned __int16)(word_70388A - 7) <= 1u
  1639.              || (unsigned __int16)(word_70388A - 39) <= 4u
  1640.              || word_70388A == 45
  1641.              || (unsigned __int16)(word_70388A - 32) <= 2u
  1642.              || word_70388A == 46)
  1643.             && (thiss->targetedEntity->flags & 7) == 3 )
  1644.             goto LABEL_578;
  1645.           if ( word_70388A != 15 || thiss->field_56 != 1 )
  1646.           {
  1647.             if ( word_70388A == 4 )
  1648.             {
  1649.               v224 = 0;
  1650.               v186 = thiss->cams[thiss->activeCam].field_C;
  1651.               if ( (v186 == 11 || v186 == 28) && !(unsigned __int8)sub_50B220(thiss->targetedEntity) )
  1652.                 v224 = 1;
  1653.               v187 = thiss->activeCam;
  1654.               v188 = thiss->cams[v187].field_C;
  1655.               if ( (v188 == 16
  1656.                  || (unsigned __int16)(v188 - 7) <= 1u
  1657.                  || (unsigned __int16)(v188 - 32) <= 2u
  1658.                  || (unsigned __int16)(v188 - 29) <= 1u
  1659.                  || (unsigned __int16)(v188 - 39) <= 4u
  1660.                  || v188 == 1
  1661.                  || v188 == 37
  1662.                  || (unsigned __int16)(v188 - 45) <= 1u
  1663.                  || v224
  1664.                  || v237)
  1665.                 && !thiss->field_58 )
  1666.               {
  1667.                 if ( (unsigned __int16)(v188 - 7) <= 1u || v188 == 34 || v188 == 16 || (unsigned __int16)(v188 - 39) <= 4u || v188 == 45 || v188 == 46 )
  1668.                 {
  1669.                   v189 = CGeneral__GetATanOfXY(thiss->cams[v187].field_168.x, thiss->cams[v187].field_168.y) - flt_68AE68;
  1670.                   dword_7E4E94[1].__parent.CenterOfMass.y = v189;
  1671.                   dword_7E4E94[1].__parent.CenterOfMass.z = v189;
  1672.                 }
  1673.                 byte_7E46EF = 1;
  1674.                 v232 = 1;
  1675.                 v190 = thiss->activeCam;
  1676.                 if ( thiss->cams[v190].field_C == 37 )
  1677.                 {
  1678.                   v191 = FindPlayerPed();
  1679.                   v192 = sub_423020(&v191->__parent.__parent.__parent.placeable);
  1680.                   sub_473A1C(&v360, &camera.cams[thiss->activeCam].?camPos, v192);
  1681.                   LODWORD(a6.y) = *(_DWORD *)&v360;
  1682.                   a6.z = v361;
  1683.                   v290 = 0;
  1684.                   CVector__Normalise((int)&a6.y);
  1685.                   LODWORD(a6.y) = 981668463;
  1686.                   if ( 0.001 == flt_68ADD8 )
  1687.                   {
  1688.                     LODWORD(a6.z) = 981668463;
  1689.                     if ( 0.001 == flt_68ADD8 )
  1690.                       LODWORD(a6.z) = 1065353216;
  1691.                   }
  1692.                   flt_7E48AC[115 * thiss->activeCam] = CGeneral__GetATanOfXY(a6.y, a6.z);
  1693.                 }
  1694.                 else
  1695.                 {
  1696.                   flt_7E48AC[115 * thiss->activeCam] = CGeneral__GetATanOfXY(thiss->cams[v190].field_168.x, thiss->cams[v190].field_168.y)
  1697.                                                      + flt_68AE70;
  1698.                 }
  1699.               }
  1700.               goto LABEL_579;
  1701.             }
  1702.             if ( word_70388A != 36 )
  1703.             {
  1704.               if ( word_70388A == 38
  1705.                 || (unsigned __int16)(word_70388A - 32) <= 1u
  1706.                 || word_70388A == 29
  1707.                 || word_7E481C[230 * thiss->activeCam] == 29 && word_70388A != 29 )
  1708.                 goto LABEL_578;
  1709.               goto LABEL_579;
  1710.             }
  1711.             v185 = thiss->cams[thiss->activeCam].field_C == 16;
  1712.           }
  1713.           else
  1714.           {
  1715.             v183 = thiss->cams[thiss->activeCam].field_C;
  1716.             if ( v183 != 7
  1717.               && v183 != 45
  1718.               && v183 != 8
  1719.               && v183 != 34
  1720.               && v183 != 37
  1721.               && !v234
  1722.               && v183 != 16
  1723.               && (unsigned __int16)(v183 - 39) > 4u
  1724.               && v183 != 46
  1725.               || (v184 = thiss->targetedEntity) == 0 )
  1726.               goto LABEL_579;
  1727.             v185 = (v184->flags & 7) == 2;
  1728.           }
  1729.           if ( v185 )
  1730. LABEL_578:
  1731.             v232 = 1;
  1732. LABEL_579:
  1733.           v193 = 460 * thiss->activeCam;
  1734.           if ( word_70388A != *(__int16 *)((char *)word_7E481C + v193) && !*(int *)((char *)dword_7E49C0 + v193) )
  1735.             v232 = 1;
  1736.           if ( thiss->field_56 )
  1737.           {
  1738.             if ( dword_7E4D74 )
  1739.             {
  1740.               v194 = *dword_7E4D74;
  1741.               if ( *dword_7E4D74 == 2 || v194 == 3 || v194 == 4 )
  1742.               {
  1743.                 v195 = thiss->targetedEntity;
  1744.                 if ( (v195->flags & 7) == 2 )
  1745.                 {
  1746.                   if ( v195->modelIndex == 153 && word_70388A != *(__int16 *)((char *)&thiss->cams[0].field_C + v193) )
  1747.                     v232 = 1;
  1748.                 }
  1749.               }
  1750.             }
  1751.           }
  1752.           if ( byte_A10B2D )
  1753.             word_70388A = 44;
  1754.           v196 = thiss->field_89;
  1755.           if ( (!v196 || v232 == 1) && word_70388A != thiss->cams[thiss->activeCam].field_C )
  1756.           {
  1757.             if ( v232 == 1 )
  1758.             {
  1759.               if ( (!thiss->field_56 || thiss->field_58)
  1760.                 && word_70388A != 4
  1761.                 && (unsigned __int16)(word_70388A - 7) > 1u
  1762.                 && word_70388A != 46
  1763.                 && word_70388A != 11
  1764.                 && word_70388A != 16
  1765.                 && word_70388A != 28
  1766.                 && (unsigned __int16)(word_70388A - 34) > 1u
  1767.                 && !byte_A10B4C )
  1768.                 CCamera__SetBehindPlayer(&camera);
  1769.               thiss->cams[thiss->activeCam].field_C = word_70388A;
  1770.               byte_7E46E2 = 1;
  1771.               sub_473A87((int)&thiss->cams[thiss->activeCam].gap_FC[48], (int)&flt_7E4DB8);
  1772.               thiss->cams[thiss->activeCam].targetedEntity = (CEntity *)dword_7E4E94;
  1773.               sub_473A87((int)&thiss->cams[thiss->activeCam].gap_FC[60], (int)&stru_7E4DC4);
  1774.               sub_473A87((int)&thiss->cams[thiss->activeCam].gap_FC[72], (int)&dword_7E4DD0);
  1775.               thiss->cams[thiss->activeCam].field_2 = byte_7E46E4;
  1776.               sub_473A87((int)&thiss->cams[thiss->activeCam].gap_FC[84], (int)&thiss->cams[(thiss->activeCam + 1) % 2].gap_FC[84]);
  1777.               *(float *)&thiss->field_E4 = *(float *)&thiss->gap_E0[0];
  1778.               *(float *)&thiss->field_14C = *(float *)&thiss->gap_140[4];
  1779.               thiss->field_89 = 0;
  1780.               thiss->field_869 = 0;
  1781.               thiss->field_62 = 0;
  1782.               thiss->cams[thiss->activeCam].field_A = 1;
  1783.               CEntity__RegisterReference(&dword_7E4E94->__parent.__parent, &dword_7E4E94);
  1784.               v197 = thiss->activeCam;
  1785.               v198 = thiss->cams[v197].targetedEntity;
  1786.               v221 = &thiss->cams[v197].targetedEntity;
  1787.             }
  1788.             else
  1789.             {
  1790.               if ( thiss->field_6A )
  1791.                 goto LABEL_671;
  1792.               LOWORD(v193) = word_70388A;
  1793.               sub_46AB08(v193);
  1794.               CEntity__RegisterReference(&dword_7E4E94->__parent.__parent, &dword_7E4E94);
  1795.               v199 = thiss->activeCam;
  1796.               v198 = thiss->cams[v199].targetedEntity;
  1797.               v221 = &thiss->cams[v199].targetedEntity;
  1798.             }
  1799.             goto LABEL_660;
  1800.           }
  1801.           if ( v196 && (v200 = thiss->cams[thiss->activeCam].field_C, word_70388A != v200) )
  1802.           {
  1803.             v201 = 1;
  1804.             if ( word_70388A == 36 || v200 == 36 )
  1805.               v201 = 0;
  1806.             if ( word_70388A == 4 && v200 == 36 )
  1807.               v201 = 0;
  1808.             if ( !thiss->field_6A )
  1809.             {
  1810.               if ( thiss->field_5B )
  1811.               {
  1812.                 if ( v196 )
  1813.                 {
  1814.                   v202 = FindPlayerPed();
  1815.                   v291 = *(float *)Matrix__GetPos(&v202->__parent.__parent.__parent.placeable.matrix.__parent) - thiss->__parent.matrix.__parent.pos.x;
  1816.                   v203 = FindPlayerPed();
  1817.                   v292 = *(float *)(Matrix__GetPos(&v203->__parent.__parent.__parent.placeable.matrix.__parent) + 4)
  1818.                        - thiss->__parent.matrix.__parent.pos.y;
  1819.                   v204 = FindPlayerPed();
  1820.                   v193 = Matrix__GetPos(&v204->__parent.__parent.__parent.placeable.matrix.__parent);
  1821.                   v293 = *(float *)(v193 + 8) - thiss->__parent.matrix.__parent.pos.z;
  1822.                   v205 = thiss->targetedEntity;
  1823.                   if ( v205 )
  1824.                   {
  1825.                     if ( (v205->flags & 7) == 3 )
  1826.                     {
  1827.                       v206 = sub_473A4F((RwV3D *)&v291);
  1828.                       v207 = sub_422FC0(v206);
  1829.                       if ( v207 > (double)flt_68AF70 )
  1830.                       {
  1831.                         if ( word_70388A == 11 || word_70388A == 28 )
  1832.                           thiss->field_6A = 1;
  1833.                       }
  1834.                     }
  1835.                   }
  1836.                 }
  1837.               }
  1838.             }
  1839.             if ( thiss->field_6A == 1 )
  1840.               v201 = 0;
  1841.             if ( v201 )
  1842.             {
  1843.               LOWORD(v193) = word_70388A;
  1844.               sub_46AAF5(v193);
  1845.               CEntity__RegisterReference(&dword_7E4E94->__parent.__parent, &dword_7E4E94);
  1846.               v198 = thiss->cams[thiss->activeCam].targetedEntity;
  1847.               v221 = &thiss->cams[thiss->activeCam].targetedEntity;
  1848. LABEL_660:
  1849.               CEntity__RegisterReference(v198, v221);
  1850.               goto LABEL_671;
  1851.             }
  1852.           }
  1853.           else
  1854.           {
  1855.             if ( word_70388A == 15 && dword_7E4E94 != (CVehicle *)dword_7E49C0[115 * (unsigned __int8)byte_7E46FE] && thiss->field_56 )
  1856.             {
  1857.               if ( v196 )
  1858.               {
  1859.                 LOWORD(v193) = word_70388A;
  1860.                 sub_46AAF5(v193);
  1861.               }
  1862.               else
  1863.               {
  1864.                 LOWORD(v193) = word_70388A;
  1865.                 sub_46AB08(v193);
  1866.               }
  1867.               CEntity__RegisterReference(&dword_7E4E94->__parent.__parent, &dword_7E4E94);
  1868.               v208 = thiss->activeCam;
  1869.               v198 = thiss->cams[v208].targetedEntity;
  1870.               v221 = &thiss->cams[v208].targetedEntity;
  1871.               goto LABEL_660;
  1872.             }
  1873.           }
  1874.           goto LABEL_671;
  1875.         }
  1876.       }
  1877.       else
  1878.       {
  1879.         if ( thiss->cams[thiss->activeCam].field_C != 1 && thiss->cams[thiss->activeCam].field_C != 16 && thiss->cams[thiss->activeCam].field_C != 37 )
  1880.           goto LABEL_509;
  1881.       }
  1882.     }
  1883.     v232 = 1;
  1884.     goto LABEL_509;
  1885.   }
  1886.   v228 = 0;
  1887.   v223 = 0;
  1888.   if ( thiss->field_71 == 1 || thiss->field_72 == 1 )
  1889.   {
  1890.     if ( word_70388A == 16 )
  1891.     {
  1892.       if ( thiss->cams[thiss->activeCam].field_C != word_70388A )
  1893.         v223 = 1;
  1894.     }
  1895.     else
  1896.     {
  1897.       v209 = LOWORD(thiss->field_700);
  1898.       if ( (v209 == 7 || v209 == 16 || v209 == 8) && (v178 = (int)CPad__GetPad(0), CPad__GetTarget((CPad *)v178)) && thiss->field_72 )
  1899.       {
  1900.         v228 = 1;
  1901.         v223 = 1;
  1902.       }
  1903.       else
  1904.       {
  1905.         if ( thiss->cams[thiss->activeCam].field_C != thiss->field_948 )
  1906.         {
  1907.           thiss->field_62 = 1;
  1908.           thiss->fixedMoveMode = 2;
  1909.           v178 = (int)CPad__GetPad(0);
  1910.           *(_WORD *)(v178 + 240) &= 0xFFFEu;
  1911.         }
  1912.       }
  1913.     }
  1914.   }
  1915.   v210 = thiss->field_89;
  1916.   if ( !v210 && thiss->field_62 == 1 && thiss->fixedMoveMode == 1 )
  1917.   {
  1918.     word_70388A = thiss->field_948;
  1919.     LOWORD(v178) = word_70388A;
  1920.     sub_46AB08(v178);
  1921.     CEntity__RegisterReference(&dword_7E4E94->__parent.__parent, &dword_7E4E94);
  1922.     v198 = thiss->cams[thiss->activeCam].targetedEntity;
  1923.     v221 = &thiss->cams[thiss->activeCam].targetedEntity;
  1924.     goto LABEL_660;
  1925.   }
  1926.   if ( v210 && thiss->field_62 == 1 && thiss->fixedMoveMode == 1 )
  1927.   {
  1928.     word_70388A = thiss->field_948;
  1929.     LOWORD(v178) = word_70388A;
  1930.     sub_46AAF5(v178);
  1931.     CEntity__RegisterReference(&dword_7E4E94->__parent.__parent, &dword_7E4E94);
  1932.     v211 = thiss->activeCam;
  1933.     v198 = thiss->cams[v211].targetedEntity;
  1934.     v221 = &thiss->cams[v211].targetedEntity;
  1935.     goto LABEL_660;
  1936.   }
  1937.   if ( thiss->field_62 == 1 && thiss->fixedMoveMode == 2 || v223 )
  1938.   {
  1939.     thiss->field_89 = 0;
  1940.     thiss->field_869 = 0;
  1941.     if ( thiss->field_71 != 1 || word_70388A != 16 )
  1942.     {
  1943.       if ( v228 )
  1944.         thiss->cams[thiss->activeCam].field_C = LOWORD(thiss->field_700);
  1945.       else
  1946.         thiss->cams[thiss->activeCam].field_C = thiss->field_948;
  1947.     }
  1948.     else
  1949.     {
  1950.       thiss->cams[thiss->activeCam].field_C = word_70388A;
  1951.     }
  1952.     byte_7E46E2 = 1;
  1953.     thiss->cams[thiss->activeCam].field_A = 1;
  1954.     sub_473A87((int)&thiss->cams[thiss->activeCam].gap_FC[48], (int)&flt_7E4DB8);
  1955.     thiss->cams[thiss->activeCam].targetedEntity = (CEntity *)dword_7E4E94;
  1956.     sub_473A87((int)&thiss->cams[thiss->activeCam].gap_FC[60], (int)&stru_7E4DC4);
  1957.     sub_473A87((int)&thiss->cams[thiss->activeCam].gap_FC[72], (int)&dword_7E4DD0);
  1958.     thiss->cams[thiss->activeCam].field_2 = byte_7E46E4;
  1959.     sub_473A87((int)&thiss->cams[thiss->activeCam].gap_FC[84], (int)&thiss->cams[(thiss->activeCam + 1) % 2].gap_FC[84]);
  1960.     byte_7E46E2 = 1;
  1961.     CEntity__RegisterReference(&dword_7E4E94->__parent.__parent, &dword_7E4E94);
  1962.     CEntity__RegisterReference(thiss->cams[thiss->activeCam].targetedEntity, &thiss->cams[thiss->activeCam].targetedEntity);
  1963.     *(float *)&thiss->field_E4 = *(float *)&thiss->gap_E0[0];
  1964.     *(float *)&thiss->field_14C = *(float *)&thiss->gap_140[4];
  1965.   }
  1966. LABEL_671:
  1967.   thiss->field_62 = 0;
  1968.   v212 = thiss->activeCam;
  1969.   if ( !thiss->cams[v212].targetedEntity )
  1970.     thiss->cams[v212].targetedEntity = (CEntity *)dword_7E4E94;
  1971.   v213 = thiss->cams[thiss->activeCam].field_C;
  1972.   if ( v213 != 17
  1973.     && ((thiss->targetedEntity->flags & 7) != 3 || v213 != 16 && v213 != 7 && v213 != 34 && (unsigned __int16)(v213 - 45) > 1u && v213 != 8) )
  1974.   {
  1975.     v215 = FindPlayerPed();
  1976.     v215->__parent.__parent.__parent.field_52 = v215->__parent.__parent.__parent.field_52 & 0xFB | 4;
  1977.   }
  1978.   else
  1979.   {
  1980.     v214 = FindPlayerPed();
  1981.     v214->__parent.__parent.__parent.field_52 &= 0xFBu;
  1982.   }
  1983.   v216 = 0;
  1984.   if ( !v238 && thiss->field_D0 == 2 )
  1985.   {
  1986.     sub_46BB24(thiss);
  1987.     v216 = 1;
  1988.     CCamera__SetBehindPlayer(thiss);
  1989.   }
  1990.   v217 = thiss->cams[thiss->activeCam].field_C;
  1991.   result = thiss->cams[thiss->activeCam].field_C;
  1992.   if ( v235 != result || v216 || v217 == 4 || v217 == 18 )
  1993.   {
  1994.     v219 = CPad__GetPad(0);
  1995.     result = CPad__ChangeStationJustDown(v219);
  1996.     if ( (_BYTE)result )
  1997.     {
  1998.       if ( byte_A10AF6 != 1 && (thiss->field_5B == 1 || thiss->field_D0 == 2) )
  1999.       {
  2000.         if ( !thiss->wideScreen && (thiss->field_D0 != 2 || byte_703684 == 1) )
  2001.           result = cDMAudio__PlayFrontEndSound(179, 0.0);
  2002.       }
  2003.     }
  2004.   }
  2005.   return result;
  2006. }

Reply to "Untitled"

Here you can reply to the paste above