comparison Outdoor.cpp @ 2091:75edfa36c4de

Слияние
author Ritor1
date Thu, 12 Dec 2013 09:28:05 +0600
parents 6c0dbff26f5d 3920278a2905
children a869b0376b48
comparison
equal deleted inserted replaced
2090:2e2c7a4edb1d 2091:75edfa36c4de
3643 //----- (00473893) -------------------------------------------------------- 3643 //----- (00473893) --------------------------------------------------------
3644 void ODM_ProcessPartyActions() 3644 void ODM_ProcessPartyActions()
3645 { 3645 {
3646 int v1; // edi@1 3646 int v1; // edi@1
3647 int v2; // ebx@1 3647 int v2; // ebx@1
3648 int v3; // eax@14 3648 int floor_level; // eax@14
3649 int v6; // esi@45 3649 int v6; // esi@45
3650 ODMFace *face; // ecx@45 3650 ODMFace *face; // ecx@45
3651 signed int v33; // eax@143 3651 signed int v33; // eax@143
3652 int v34; // esi@143 3652 int v34; // esi@143
3653 int v35; // esi@147 3653 int v35; // esi@147
3661 signed int v44; // edx@184 3661 signed int v44; // edx@184
3662 int v45; // ecx@200 3662 int v45; // ecx@200
3663 BSPModel *pModel; // eax@203 3663 BSPModel *pModel; // eax@203
3664 ODMFace *pODMFace; // esi@203 3664 ODMFace *pODMFace; // esi@203
3665 int v48; // eax@203 3665 int v48; // eax@203
3666 char v49; // zf@203
3667 char v50; // sf@203
3668 unsigned __int8 v51; // of@203
3669 int v52; // eax@203
3670 BSPModel *v54; // eax@215 3666 BSPModel *v54; // eax@215
3671 int v55; // eax@217 3667 int v55; // eax@217
3672 signed int v56; // ebx@228
3673 int v57; // eax@228
3674 BSPModel *v58; // eax@228 3668 BSPModel *v58; // eax@228
3675 unsigned __int64 v59; // qax@228 3669 unsigned __int64 v59; // qax@228
3676 BSPModel *v60; // eax@228 3670 BSPModel *v60; // eax@228
3677 unsigned __int64 v61; // qax@228 3671 unsigned __int64 v61; // qax@228
3678 int v62; // eax@241 3672 int v62; // eax@241
3679 unsigned int v65; // ebx@263
3680 unsigned int v66; // esi@263 3673 unsigned int v66; // esi@263
3681 int v67; // eax@263
3682 signed int v68; // ecx@263 3674 signed int v68; // ecx@263
3683 int v69; // eax@263 3675 int v69; // eax@263
3684 int v70; // ebx@271
3685 int v71; // esi@271
3686 int v72; // edi@271
3687 int v73; // eax@271
3688 unsigned int v76; // edi@293 3676 unsigned int v76; // edi@293
3689 bool v77; // edx@297 3677 bool v77; // edx@297
3690 bool v78; // ecx@303 3678 bool v78; // ecx@303
3691 int v79; // ecx@314 3679 int v79; // ecx@314
3692 __int16 v80; // dx@317 3680 __int16 v80; // dx@317
3708 int v102; // [sp+20h] [bp-74h]@1 3696 int v102; // [sp+20h] [bp-74h]@1
3709 int v103; // [sp+24h] [bp-70h]@1 3697 int v103; // [sp+24h] [bp-70h]@1
3710 bool bFeatherFall; // [sp+28h] [bp-6Ch]@4 3698 bool bFeatherFall; // [sp+28h] [bp-6Ch]@4
3711 int v105; // [sp+2Ch] [bp-68h]@24 3699 int v105; // [sp+2Ch] [bp-68h]@24
3712 bool bWaterWalk; // [sp+30h] [bp-64h]@1 3700 bool bWaterWalk; // [sp+30h] [bp-64h]@1
3713 int v109; // [sp+3Ch] [bp-58h]@28 3701 int ceiling_height; // [sp+3Ch] [bp-58h]@28
3714 int v110; // [sp+40h] [bp-54h]@180 3702 int v110; // [sp+40h] [bp-54h]@180
3715 int v111; // [sp+44h] [bp-50h]@14 3703 int v111; // [sp+44h] [bp-50h]@14
3716 bool hovering; // [sp+48h] [bp-4Ch]@1 3704 bool hovering; // [sp+48h] [bp-4Ch]@1
3717 int v113; // [sp+4Ch] [bp-48h]@1 3705 int v113; // [sp+4Ch] [bp-48h]@1
3718 bool party_running_flag; // [sp+50h] [bp-44h]@1 3706 bool party_running_flag; // [sp+50h] [bp-44h]@1
3723 int _angle_x; // [sp+68h] [bp-2Ch]@48 3711 int _angle_x; // [sp+68h] [bp-2Ch]@48
3724 unsigned int v122; // [sp+70h] [bp-24h]@180 3712 unsigned int v122; // [sp+70h] [bp-24h]@180
3725 int pZ; // [sp+74h] [bp-20h]@1 3713 int pZ; // [sp+74h] [bp-20h]@1
3726 bool party_walking_flag; // [sp+78h] [bp-1Ch]@1 3714 bool party_walking_flag; // [sp+78h] [bp-1Ch]@1
3727 int _angle_y; // [sp+7Ch] [bp-18h]@48 3715 int _angle_y; // [sp+7Ch] [bp-18h]@48
3728 int v126; // [sp+80h] [bp-14h]@48
3729 int v128; // [sp+88h] [bp-Ch]@1 3716 int v128; // [sp+88h] [bp-Ch]@1
3730 int v129; // [sp+8Ch] [bp-8h]@92 3717 int v129; // [sp+8Ch] [bp-8h]@92
3731 3718
3732 v1 = 0; 3719 v1 = 0;
3733 v103 = 0; 3720 v103 = 0;
3771 bWaterWalk = false; 3758 bWaterWalk = false;
3772 } 3759 }
3773 3760
3774 int bmodel_standing_on_pid; 3761 int bmodel_standing_on_pid;
3775 int is_on_water = false; 3762 int is_on_water = false;
3776 v3 = ODM_GetFloorLevel(pX, pY, pZ, pParty->uPartyHeight, &is_on_water, &bmodel_standing_on_pid, bWaterWalk); 3763 floor_level = ODM_GetFloorLevel(pX, pY, pZ, pParty->uPartyHeight, &is_on_water, &bmodel_standing_on_pid, bWaterWalk);
3777 int is_not_on_bmodel = bmodel_standing_on_pid == 0; 3764 int is_not_on_bmodel = bmodel_standing_on_pid == 0;
3778 3765
3779 v111 = v3; 3766 v111 = floor_level;
3780 if ( bFeatherFall ) 3767 if ( bFeatherFall )
3781 pParty->uFallStartY = v3; 3768 pParty->uFallStartY = floor_level;
3782 else 3769 else
3783 v3 = pParty->uFallStartY; 3770 floor_level = pParty->uFallStartY;
3784 if ( v3 - pZ > 512 && !bFeatherFall && pZ <= v111 + 1 ) 3771
3772 if ( floor_level - pZ > 512 && !bFeatherFall && pZ <= v111 + 1 )// 3D Model
3785 { 3773 {
3786 if (pParty->uFlags & PARTY_FLAGS_1_LANDING) 3774 if (pParty->uFlags & PARTY_FLAGS_1_LANDING)
3787 { 3775 {
3788 pParty->uFlags &= ~PARTY_FLAGS_1_LANDING; 3776 pParty->uFlags &= ~PARTY_FLAGS_1_LANDING;
3789 } 3777 }
3794 pParty->pPlayers[i].ReceiveDamage( 3782 pParty->pPlayers[i].ReceiveDamage(
3795 (signed int)((pParty->uFallStartY - pZ) * (unsigned __int64)(pParty->pPlayers[i].GetMaxHealth() / 10)) / 256, DMGT_PHISYCAL); 3783 (signed int)((pParty->uFallStartY - pZ) * (unsigned __int64)(pParty->pPlayers[i].GetMaxHealth() / 10)) / 256, DMGT_PHISYCAL);
3796 v105 = 20 - pParty->pPlayers[i].GetParameterBonus(pParty->pPlayers[i].GetActualEndurance()); 3784 v105 = 20 - pParty->pPlayers[i].GetParameterBonus(pParty->pPlayers[i].GetActualEndurance());
3797 pParty->pPlayers[i].SetRecoveryTime((signed __int64)((double)v105 * flt_6BE3A4_debug_recmod1 * 2.133333333333333)); 3785 pParty->pPlayers[i].SetRecoveryTime((signed __int64)((double)v105 * flt_6BE3A4_debug_recmod1 * 2.133333333333333));
3798 } 3786 }
3799 //} 3787 }
3800 //while ( (signed int)v4 <= (signed int)&pPlayers[4] ); 3788 }
3801 } 3789
3802 } 3790 ceiling_height = -1;
3803 v109 = -1;
3804 if ( pParty->bFlying ) 3791 if ( pParty->bFlying )
3805 v109 = GetCeilingHeight(pX, pY, pZ + pParty->uPartyHeight, (int)&v102); 3792 ceiling_height = GetCeilingHeight(pX, pY, pZ + pParty->uPartyHeight, (int)&v102);//
3806 //v107 = bmodel_standing_on_pid == 0; 3793 //v107 = bmodel_standing_on_pid == 0;
3807 v105 = v111 + 1; 3794 v105 = v111 + 1;
3808 if ( pZ <= v111 + 1 ) 3795 if ( pZ <= v111 + 1 )
3809 { 3796 {
3810 v109 = -1; 3797 ceiling_height = -1;
3811 pParty->bFlying = false; 3798 pParty->bFlying = false;
3812 } 3799 }
3813 else 3800 else
3814 hovering = true; 3801 hovering = true;
3815 high_fall_flag = pZ - v111 <= 32; 3802 high_fall_flag = pZ - v111 <= 32;
3840 v103 = *(short *)(v7->pFacePlane.vNormal.x + 308 * v6 + 292); 3827 v103 = *(short *)(v7->pFacePlane.vNormal.x + 308 * v6 + 292);
3841 }*/ 3828 }*/
3842 if ( BYTE3(face[v6].uAttributes) & 4 ) 3829 if ( BYTE3(face[v6].uAttributes) & 4 )
3843 { 3830 {
3844 pParty->floor_face_pid = PID(OBJECT_BModel, bmodel_standing_on_pid); 3831 pParty->floor_face_pid = PID(OBJECT_BModel, bmodel_standing_on_pid);
3845 v103 = face[v6].sCogTriggeredID; 3832 v103 = face[v6].sCogTriggeredID; //
3846 } 3833 }
3847 } 3834 }
3848 } 3835 }
3849 } 3836 }
3850 pParty->floor_face_pid = PID(OBJECT_BModel, bmodel_standing_on_pid); 3837 pParty->floor_face_pid = PID(OBJECT_BModel, bmodel_standing_on_pid);
3851 } 3838 }
3852 _walk_speed = pParty->uWalkSpeed; 3839 _walk_speed = pParty->uWalkSpeed;
3853 _angle_y = pParty->sRotationY; 3840 _angle_y = pParty->sRotationY;
3854 _angle_x = pParty->sRotationX; 3841 _angle_x = pParty->sRotationX;
3855 v126 = pEventTimer->dt_in_some_format; 3842 //v126 = pEventTimer->dt_in_some_format;
3856 /*v119 = (Player **)((unsigned __int64)(pEventTimer->dt_in_some_format 3843 /*v119 = (Player **)((unsigned __int64)(pEventTimer->dt_in_some_format
3857 * (signed __int64)((signed int)(pParty->field_20_prolly_turn_speed 3844 * (signed __int64)((signed int)(pParty->field_20_prolly_turn_speed
3858 * stru_5C6E00->uIntegerPi) 3845 * stru_5C6E00->uIntegerPi)
3859 / 180)) >> 16);*/ 3846 / 180)) >> 16);*/
3860 __int64 dturn = (unsigned __int64)(pEventTimer->dt_in_some_format * (signed __int64)((signed int)(pParty->y_rotation_speed * stru_5C6E00->uIntegerPi) / 180)) >> 16; 3847 __int64 dturn = (unsigned __int64)(pEventTimer->dt_in_some_format * (signed __int64)((signed int)(pParty->y_rotation_speed * stru_5C6E00->uIntegerPi) / 180)) >> 16;
3885 } 3872 }
3886 v1 = 0; 3873 v1 = 0;
3887 v2 = 0; 3874 v2 = 0;
3888 pParty->uFallSpeed = 0; 3875 pParty->uFallSpeed = 0;
3889 *(float *)&v128 = 0.0; 3876 *(float *)&v128 = 0.0;
3890 if ( v102 && pZ < v109 && (signed int)(pParty->uPartyHeight + pZ) >= v109 )// () 3877 if ( v102 && pZ < ceiling_height && (signed int)(pParty->uPartyHeight + pZ) >= ceiling_height )// ()
3891 { 3878 {
3892 pParty->field_6E0 = 0; 3879 pParty->field_6E0 = 0;
3893 pParty->field_6E4 = 0; 3880 pParty->field_6E4 = 0;
3894 pPartyActionQueue->uNumActions = 0; 3881 pPartyActionQueue->uNumActions = 0;
3895 pParty->uFlags |= PARTY_FLAGS_1_LANDING; 3882 pParty->uFlags |= PARTY_FLAGS_1_LANDING;
3896 pParty->vPosition.z = v109 - pParty->uPartyHeight - 31; 3883 pParty->vPosition.z = ceiling_height - pParty->uPartyHeight - 31;
3897 pParty->field_6F0 = pZ; 3884 pParty->field_6F0 = pZ;
3898 pParty->bFlying = false; 3885 pParty->bFlying = false;
3899 pZ = v109 - pParty->uPartyHeight - 31; 3886 pZ = ceiling_height - pParty->uPartyHeight - 31;
3900 v113 = pParty->field_6F0; 3887 v113 = pParty->field_6F0;
3901 } 3888 }
3902 pParty->uFallSpeed = 0; 3889 pParty->uFallSpeed = 0;
3903 pModel = (BSPModel *)1; 3890 pModel = (BSPModel *)1;
3904 } 3891 }
4127 break; 4114 break;
4128 4115
4129 case PARTY_Jump: 4116 case PARTY_Jump:
4130 if ( (!partyAtHighSlope || bmodel_standing_on_pid) && !hovering && pParty->field_24 && !(pParty->uFlags & 4) && !(BYTE1(pParty->uFlags) & 2) ) 4117 if ( (!partyAtHighSlope || bmodel_standing_on_pid) && !hovering && pParty->field_24 && !(pParty->uFlags & 4) && !(BYTE1(pParty->uFlags) & 2) )
4131 { 4118 {
4132 v126 = pParty->field_24 << 6; 4119 //v126 = pParty->field_24 << 6;
4133 hovering = true; 4120 hovering = true;
4134 pParty->uFallSpeed = (signed __int64)((double)(pParty->field_24 << 6) * 1.5 + (double)pParty->uFallSpeed); 4121 pParty->uFallSpeed = (signed __int64)((double)(pParty->field_24 << 6) * 1.5 + (double)pParty->uFallSpeed);
4135 } 4122 }
4136 break; 4123 break;
4137 4124
4150 4137
4151 4138
4152 } 4139 }
4153 } 4140 }
4154 4141
4155 //LABEL_123:
4156 pParty->sRotationY = _angle_y; 4142 pParty->sRotationY = _angle_y;
4157 pParty->sRotationX = _angle_x; 4143 pParty->sRotationX = _angle_x;
4158 if ( pZ < v111 || pParty->bFlying) 4144 if ( pZ < v111 || pParty->bFlying)
4159 { 4145 {
4160 if ( pParty->bFlying ) 4146 if ( pParty->bFlying )
4161 { 4147 {
4162 v126 = stru_5C6E00->Cos(GetTickCount()); 4148 //v126 = stru_5C6E00->Cos(GetTickCount());
4163 v129 = (unsigned __int64)(4i64 * v126) >> 16; 4149 v129 = (unsigned __int64)(4i64 * stru_5C6E00->Cos(GetTickCount())) >> 16;
4164 pZ = v113 + v129; 4150 pZ = v113 + v129;
4165 if ( pModel ) 4151 if ( pModel )
4166 pZ = v113; 4152 pZ = v113;
4167 if (pParty->FlyActive()) 4153 if (pParty->FlyActive())
4168 stru_5E4C90_MapPersistVars._decor_events[20 * pParty->pPartyBuffs[PARTY_BUFF_FLY].uOverlayID + 119] &= 0xFEu; 4154 stru_5E4C90_MapPersistVars._decor_events[20 * pParty->pPartyBuffs[PARTY_BUFF_FLY].uOverlayID + 119] &= 0xFEu;
4235 } 4221 }
4236 } 4222 }
4237 } 4223 }
4238 } 4224 }
4239 else 4225 else
4240 { 4226 pParty->uFallStartY = pZ;
4241 //LABEL_150:
4242 pParty->uFallStartY = pZ;
4243 }
4244 4227
4245 if ( v2 * v2 + v1 * v1 < 400 && !partyAtHighSlope ) 4228 if ( v2 * v2 + v1 * v1 < 400 && !partyAtHighSlope )
4246 { 4229 {
4247 *(float *)&v128 = 0.0; 4230 *(float *)&v128 = 0.0;
4248 v2 = 0; 4231 v2 = 0;
4249 } 4232 }
4233 //---------------------------------------------------------------------
4250 stru_721530.field_84 = -1; 4234 stru_721530.field_84 = -1;
4251 stru_721530.field_70 = 0; 4235 stru_721530.field_70 = 0;
4252 stru_721530.prolly_normal_d = pParty->field_14_radius; 4236 stru_721530.prolly_normal_d = pParty->field_14_radius;
4253 stru_721530.field_8_radius = pParty->field_14_radius >> 1; 4237 stru_721530.field_8_radius = pParty->field_14_radius >> 1;
4254 v126 = 0;
4255 stru_721530.field_0 = 1; 4238 stru_721530.field_0 = 1;
4256 stru_721530.height = pParty->uPartyHeight - 32; 4239 stru_721530.height = pParty->uPartyHeight - 32;
4257 do 4240 for ( uint i = 0; i < 100; i++ )
4258 { 4241 {
4259 stru_721530.position.x = pX; 4242 stru_721530.position.x = pX;
4243 stru_721530.position.y = pY;
4244 stru_721530.position.z = stru_721530.height + pZ + 1;
4245
4260 stru_721530.normal.x = pX; 4246 stru_721530.normal.x = pX;
4261 stru_721530.velocity.x = v2;
4262 stru_721530.position.y = pY;
4263 stru_721530.normal.y = pY; 4247 stru_721530.normal.y = pY;
4264 stru_721530.normal.z = stru_721530.prolly_normal_d + pZ + 1; 4248 stru_721530.normal.z = stru_721530.prolly_normal_d + pZ + 1;
4265 stru_721530.position.z = stru_721530.height + pZ + 1; 4249
4250 stru_721530.velocity.x = v2;
4266 stru_721530.velocity.y = v128; 4251 stru_721530.velocity.y = v128;
4267 stru_721530.velocity.z = pParty->uFallSpeed; 4252 stru_721530.velocity.z = pParty->uFallSpeed;
4253
4254 stru_721530.uSectorID = 0;
4268 v36 = 0; 4255 v36 = 0;
4269 stru_721530.uSectorID = 0; 4256 if ( pParty->bTurnBasedModeOn == true && pTurnEngine->turn_stage == 3 )
4270 if ( pParty->bTurnBasedModeOn == 1 && pTurnEngine->turn_stage == 3 )
4271 v36 = 13312; 4257 v36 = 13312;
4272 if ( stru_721530._47050A(v36) ) 4258 if ( stru_721530._47050A(v36) )
4273 break; 4259 break;
4274 _46E889_collide_against_bmodels(1u); 4260 _46E889_collide_against_bmodels(1);
4275 v37 = WorldPosToGridCellZ(pParty->vPosition.y); 4261 v37 = WorldPosToGridCellZ(pParty->vPosition.y);
4276 v38 = WorldPosToGridCellX(pParty->vPosition.x); 4262 v38 = WorldPosToGridCellX(pParty->vPosition.x);
4277 _46E26D_collide_against_sprites(v38, v37); 4263 _46E26D_collide_against_sprites(v38, v37);
4278 _46ED8A_collide_against_sprite_objects(4u); 4264 _46ED8A_collide_against_sprite_objects(4);
4279 for ( i = 0; i < (signed int)uNumActors; ++i ) 4265 for ( i = 0; i < (signed int)uNumActors; ++i )
4280 Actor::_46DF1A_collide_against_actor(i, 0); 4266 Actor::_46DF1A_collide_against_actor(i, 0);
4281 if ( stru_721530.field_7C >= stru_721530.field_6C ) 4267 if ( stru_721530.field_7C >= stru_721530.field_6C )
4282 { 4268 {
4283 _angle_x = stru_721530.normal2.x; 4269 _angle_x = stru_721530.normal2.x;
4296 v129 = ODM_GetFloorLevel(_angle_x, pY, v40, pParty->uPartyHeight, &is_on_water, &v97, 0); 4282 v129 = ODM_GetFloorLevel(_angle_x, pY, v40, pParty->uPartyHeight, &is_on_water, &v97, 0);
4297 int v119 = ODM_GetFloorLevel(pX, _angle_y, v40, pParty->uPartyHeight, &is_on_water, &v110, 0); 4283 int v119 = ODM_GetFloorLevel(pX, _angle_y, v40, pParty->uPartyHeight, &is_on_water, &v110, 0);
4298 pModel = (BSPModel *)IsTerrainSlopeTooHigh(_angle_x, pY); 4284 pModel = (BSPModel *)IsTerrainSlopeTooHigh(_angle_x, pY);
4299 v42 = IsTerrainSlopeTooHigh(pX, _angle_y); 4285 v42 = IsTerrainSlopeTooHigh(pX, _angle_y);
4300 is_not_on_bmodel = false; 4286 is_not_on_bmodel = false;
4301 v118 = v42; 4287 //v118 = v42;
4302 if ( !v97 && !v110 && !bmodel_standing_on_pid ) 4288 if ( !v97 && !v110 && !bmodel_standing_on_pid )
4303 is_not_on_bmodel = true; 4289 is_not_on_bmodel = true;
4304 v43 = 1; 4290 v43 = 1;
4305 v44 = 1; 4291 v44 = 1;
4306 if ( bUnderwater || !is_not_on_bmodel ) 4292 if ( bUnderwater || !is_not_on_bmodel )
4307 { 4293 {
4308 pX = _angle_x; 4294 pX = _angle_x;
4309 if ( v43 ) 4295 if ( v43 )
4310 pY = _angle_y; 4296 pY = _angle_y;
4311 } 4297 }
4312 else 4298 else
4313 { 4299 {
4314 if ( pModel && v129 > pZ ) 4300 if ( pModel && v129 > pZ )
4315 v44 = 0; 4301 v44 = 0;
4316 if ( v118 && v119 > pZ ) 4302 if ( v42 && v119 > pZ )
4317 v43 = 0; 4303 v43 = 0;
4318 if ( v44 ) 4304 if ( v44 )
4319 { 4305 {
4320 pX = _angle_x; 4306 pX = _angle_x;
4321 if ( v43 ) 4307 if ( v43 )
4322 pY = _angle_y; 4308 pY = _angle_y;
4323 } 4309 }
4324 else if ( v43 ) 4310 else if ( v43 )
4325 pY = _angle_y; 4311 pY = _angle_y;
4326 else 4312 else
4327 { 4313 {
4328 pModel = (BSPModel *)ODM_GetFloorLevel(_angle_x, _angle_y, v40, pParty->uPartyHeight, &is_on_water, &bmodel_standing_on_pid, 0); 4314 pModel = (BSPModel *)ODM_GetFloorLevel(_angle_x, _angle_y, v40, pParty->uPartyHeight, &is_on_water, &bmodel_standing_on_pid, 0);
4329 if ( IsTerrainSlopeTooHigh(_angle_x, _angle_y) && (signed int)pModel <= pZ ) 4315 if ( IsTerrainSlopeTooHigh(_angle_x, _angle_y) && (signed int)pModel <= pZ )
4330 { 4316 {
4331 v43 = 1; 4317 v43 = 1;
4332 pX = _angle_x; 4318 pX = _angle_x;
4333 if ( v43 ) 4319 if ( v43 )
4334 pY = _angle_y; 4320 pY = _angle_y;
4335 } 4321 }
4336 } 4322 }
4337 } 4323 }
4338 if ( stru_721530.field_7C >= stru_721530.field_6C ) 4324 if ( stru_721530.field_7C >= stru_721530.field_6C )
4339 { 4325 {
4340 if ( !is_not_on_bmodel ) 4326 if ( !is_not_on_bmodel )
4341 { 4327 {
4342 pX = stru_721530.normal2.x; 4328 pX = stru_721530.normal2.x;
4354 { 4340 {
4355 if (pParty->Invisible()) 4341 if (pParty->Invisible())
4356 pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].Reset(); 4342 pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].Reset();
4357 4343
4358 viewparams->bRedrawGameUI = true; 4344 viewparams->bRedrawGameUI = true;
4359 v2 = (unsigned __int64)(58500i64 * v2) >> 16; 4345 v2 = (unsigned __int64)(58500i64 * v2) >> 16;
4360 pModel = (BSPModel *)58500; 4346 pModel = (BSPModel *)58500;
4361 v128 = (unsigned __int64)(58500i64 * v128) >> 16; 4347 v128 = (unsigned __int64)(58500i64 * v128) >> 16;
4362 v122 = (unsigned __int64)(58500i64 * pParty->uFallSpeed) >> 16; 4348 v122 = (unsigned __int64)(58500i64 * pParty->uFallSpeed) >> 16;
4363 ++v126; 4349 pParty->uFallSpeed = (unsigned __int64)(58500i64 * pParty->uFallSpeed) >> 16;
4364 pParty->uFallSpeed = (unsigned __int64)(58500i64 * pParty->uFallSpeed) >> 16; 4350 continue;
4365 continue; 4351 }
4366 }
4367 if ( PID_TYPE(stru_721530.uFaceID) == OBJECT_Decoration) 4352 if ( PID_TYPE(stru_721530.uFaceID) == OBJECT_Decoration)
4368 { 4353 {
4369 v56 = integer_sqrt(v2 * v2 + v128 * v128); 4354 //v118 = integer_sqrt(v2 * v2 + v128 * v128);
4370 v118 = v56; 4355 v129 = stru_5C6E00->Atan2(_angle_x - pLevelDecorations[(signed int)stru_721530.uFaceID >> 3].vPosition.x,
4371 v57 = stru_5C6E00->Atan2(_angle_x - pLevelDecorations[(signed int)stru_721530.uFaceID >> 3].vPosition.x,
4372 _angle_y - pLevelDecorations[(signed int)stru_721530.uFaceID >> 3].vPosition.y); 4356 _angle_y - pLevelDecorations[(signed int)stru_721530.uFaceID >> 3].vPosition.y);
4373 v129 = v57; 4357 v59 = (signed int)stru_5C6E00->Cos(v129) * (signed __int64)integer_sqrt(v2 * v2 + v128 * v128);
4374 v58 = (BSPModel *)stru_5C6E00->Cos(v57);
4375 pModel = v58;
4376 v59 = (signed int)v58 * (signed __int64)v56;
4377 v122 = v59 >> 16; 4358 v122 = v59 >> 16;
4378 v2 = v59 >> 16; 4359 v2 = v59 >> 16;
4379 v60 = (BSPModel *)stru_5C6E00->Sin(v129); 4360 v61 = (signed int)stru_5C6E00->Sin(v129) * (signed __int64)integer_sqrt(v2 * v2 + v128 * v128);
4380 pModel = v60;
4381 v61 = (signed int)v60 * (signed __int64)v118;
4382 v122 = v61 >> 16; 4361 v122 = v61 >> 16;
4383 v128 = v61 >> 16; 4362 v128 = v61 >> 16;
4384 } 4363 }
4385 else 4364 else
4386 { 4365 {
4387 if ( PID_TYPE(stru_721530.uFaceID) == OBJECT_BModel) 4366 if ( PID_TYPE(stru_721530.uFaceID) == OBJECT_BModel)
4388 { 4367 {
4389 pParty->bFlying = false; 4368 pParty->bFlying = false;
4390 pModel = &pOutdoor->pBModels[(signed int)stru_721530.uFaceID >> 9]; 4369 pModel = &pOutdoor->pBModels[(signed int)stru_721530.uFaceID >> 9];
4391 //v127 = v46;
4392 pODMFace = &pModel->pFaces[((signed int)stru_721530.uFaceID >> 3) & 0x3F]; 4370 pODMFace = &pModel->pFaces[((signed int)stru_721530.uFaceID >> 3) & 0x3F];
4393 v48 = pODMFace->pBoundingBox.z2 - pODMFace->pBoundingBox.z1; 4371 v48 = pODMFace->pBoundingBox.z2 - pODMFace->pBoundingBox.z1;
4394 v51 = __OFSUB__(v48, 32); 4372 v129 = v48 <= 32;
4395 v49 = v48 == 32; 4373 v119 = pODMFace->pFacePlane.vNormal.z < 46378;
4396 v50 = v48 - 32 < 0;
4397 v52 = pODMFace->pFacePlane.vNormal.z;
4398 v129 = (unsigned __int8)(v50 ^ v51 | v49);
4399 v119 = v52 < 46378;
4400 if ( bUnderwater == 1 ) 4374 if ( bUnderwater == 1 )
4401 v119 = 0; 4375 v119 = 0;
4402 if ( pODMFace->uPolygonType == POLYGON_Floor ) 4376 if ( pODMFace->uPolygonType == POLYGON_Floor )
4403 { 4377 {
4404 if ( pParty->uFallSpeed < 0 ) 4378 if ( pParty->uFallSpeed < 0 )
4410 *(float *)&v128 = 0.0; 4384 *(float *)&v128 = 0.0;
4411 } 4385 }
4412 if ( pParty->floor_face_pid != v45 && (pODMFace->uAttributes & FACE_PRESSURE_PLATE)) 4386 if ( pParty->floor_face_pid != v45 && (pODMFace->uAttributes & FACE_PRESSURE_PLATE))
4413 { 4387 {
4414 pParty->floor_face_pid = v45; 4388 pParty->floor_face_pid = v45;
4415 v103 = pODMFace->sCogTriggeredID; 4389 v103 = pODMFace->sCogTriggeredID; //
4416 } 4390 }
4417 v2 = (unsigned __int64)(58500i64 * v2) >> 16; 4391 v2 = (unsigned __int64)(58500i64 * v2) >> 16;
4418 pModel = (BSPModel *)58500; 4392 pModel = (BSPModel *)58500;
4419 v128 = (unsigned __int64)(58500i64 * v128) >> 16; 4393 v128 = (unsigned __int64)(58500i64 * v128) >> 16;
4420 v122 = (unsigned __int64)(58500i64 * pParty->uFallSpeed) >> 16; 4394 v122 = (unsigned __int64)(58500i64 * pParty->uFallSpeed) >> 16;
4421 ++v126;
4422 pParty->uFallSpeed = (unsigned __int64)(58500i64 * pParty->uFallSpeed) >> 16; 4395 pParty->uFallSpeed = (unsigned __int64)(58500i64 * pParty->uFallSpeed) >> 16;
4423 continue; 4396 continue;
4424 } 4397 }
4425 if ( !v129 && (pODMFace->uPolygonType != POLYGON_InBetweenFloorAndWall || v119) )// 4398 if ( !v129 && (pODMFace->uPolygonType != POLYGON_InBetweenFloorAndWall || v119) )//
4426 { 4399 {
4427 v118 = abs(v128 * pODMFace->pFacePlane.vNormal.y + pParty->uFallSpeed * v52 + v2 * pODMFace->pFacePlane.vNormal.x) >> 16; 4400 v118 = abs(v128 * pODMFace->pFacePlane.vNormal.y
4401 + pParty->uFallSpeed * pODMFace->pFacePlane.vNormal.z
4402 + v2 * pODMFace->pFacePlane.vNormal.x) >> 16;
4428 if ((stru_721530.speed >> 3) > v118 ) 4403 if ((stru_721530.speed >> 3) > v118 )
4429 v118 = stru_721530.speed >> 3; 4404 v118 = stru_721530.speed >> 3;
4430 v129 = (unsigned __int64)(v118 * (signed __int64)pODMFace->pFacePlane.vNormal.x) >> 16; 4405 v2 += (unsigned __int64)(v118 * (signed __int64)pODMFace->pFacePlane.vNormal.x) >> 16;
4431 _walk_speed = (unsigned __int64)(v118 * (signed __int64)pODMFace->pFacePlane.vNormal.y) >> 16; 4406 v128 += (unsigned __int64)(v118 * (signed __int64)pODMFace->pFacePlane.vNormal.y) >> 16;
4432 v54 = 0; 4407 v54 = 0;
4433 if ( !v119 ) 4408 if ( !v119 )
4434 { 4409 pParty->uFallSpeed += (unsigned __int64)(v118 * (signed __int64)(signed int)pODMFace->pFacePlane.vNormal.z) >> 16;
4435 pModel = (BSPModel *)pODMFace->pFacePlane.vNormal.z;
4436 pModel = (BSPModel *)((unsigned __int64)(v118 * (signed __int64)(signed int)pModel) >> 16);
4437 v54 = pModel;
4438 }
4439 pParty->uFallSpeed += (int)v54;
4440 v128 += _walk_speed;
4441 v2 += v129;
4442 v55 = stru_721530.prolly_normal_d 4410 v55 = stru_721530.prolly_normal_d
4443 - ((signed int)(pODMFace->pFacePlane.dist 4411 - ((signed int)(pODMFace->pFacePlane.dist
4444 + v122 * pODMFace->pFacePlane.vNormal.z 4412 + v122 * pODMFace->pFacePlane.vNormal.z
4445 + _angle_y * pODMFace->pFacePlane.vNormal.y 4413 + _angle_y * pODMFace->pFacePlane.vNormal.y
4446 + _angle_x * pODMFace->pFacePlane.vNormal.x) >> 16); 4414 + _angle_x * pODMFace->pFacePlane.vNormal.x) >> 16);
4449 pX = _angle_x + (pODMFace->pFacePlane.vNormal.x * v55 >> 16); 4417 pX = _angle_x + (pODMFace->pFacePlane.vNormal.x * v55 >> 16);
4450 pY = _angle_y + (pODMFace->pFacePlane.vNormal.y * v55 >> 16); 4418 pY = _angle_y + (pODMFace->pFacePlane.vNormal.y * v55 >> 16);
4451 if ( !v119 ) 4419 if ( !v119 )
4452 pZ = v122 + (pODMFace->pFacePlane.vNormal.z * v55 >> 16); 4420 pZ = v122 + (pODMFace->pFacePlane.vNormal.z * v55 >> 16);
4453 } 4421 }
4454 //LABEL_220: 4422 if ( pParty->floor_face_pid != stru_721530.uFaceID && BYTE3(pODMFace->uAttributes) & 4 )
4455 v45 = stru_721530.uFaceID; 4423 {
4456 if ( pParty->floor_face_pid != v45 && BYTE3(pODMFace->uAttributes) & 4 ) 4424 pParty->floor_face_pid = stru_721530.uFaceID;
4457 { 4425 v103 = pODMFace->sCogTriggeredID; //
4458 pParty->floor_face_pid = v45; 4426 }
4459 v103 = pODMFace->sCogTriggeredID; 4427 v2 = (unsigned __int64)(58500i64 * v2) >> 16;
4460 } 4428 pModel = (BSPModel *)58500;
4461 v2 = (unsigned __int64)(58500i64 * v2) >> 16; 4429 v128 = (unsigned __int64)(58500i64 * v128) >> 16;
4462 pModel = (BSPModel *)58500; 4430 v122 = (unsigned __int64)(58500i64 * pParty->uFallSpeed) >> 16;
4463 v128 = (unsigned __int64)(58500i64 * v128) >> 16; 4431 pParty->uFallSpeed = (unsigned __int64)(58500i64 * pParty->uFallSpeed) >> 16;
4464 v122 = (unsigned __int64)(58500i64 * pParty->uFallSpeed) >> 16; 4432 continue;
4465 ++v126;
4466 pParty->uFallSpeed = (unsigned __int64)(58500i64 * pParty->uFallSpeed) >> 16;
4467 continue;
4468 } 4433 }
4469 v118 = abs(v128 * pODMFace->pFacePlane.vNormal.y + pParty->uFallSpeed * v52 + v2 * pODMFace->pFacePlane.vNormal.x) >> 16; 4434 v118 = abs(v128 * pODMFace->pFacePlane.vNormal.y
4435 + pParty->uFallSpeed * pODMFace->pFacePlane.vNormal.z + v2 * pODMFace->pFacePlane.vNormal.x) >> 16;
4470 if ((stru_721530.speed >> 3) > v118 ) 4436 if ((stru_721530.speed >> 3) > v118 )
4471 v118 = stru_721530.speed >> 3; 4437 v118 = stru_721530.speed >> 3;
4472 v122 = pODMFace->pFacePlane.vNormal.x; 4438 v2 += (unsigned __int64)(v118 * (signed __int64)(signed int)pODMFace->pFacePlane.vNormal.x) >> 16;
4473 v122 = (unsigned __int64)(v118 * (signed __int64)(signed int)v122) >> 16; 4439 v128 += (unsigned __int64)(v118 * (signed __int64)(signed int)pODMFace->pFacePlane.vNormal.y) >> 16;
4474 pModel = (BSPModel *)pODMFace->pFacePlane.vNormal.y; 4440 pParty->uFallSpeed += (unsigned __int64)(v118 * (signed __int64)pODMFace->pFacePlane.vNormal.z) >> 16;
4475 pModel = (BSPModel *)((unsigned __int64)(v118 * (signed __int64)(signed int)pModel) >> 16);
4476 v129 = pODMFace->pFacePlane.vNormal.z;
4477 v129 = (unsigned __int64)(v118 * (signed __int64)v129) >> 16;
4478 pParty->uFallSpeed += v129;
4479 v2 += v122;
4480 v128 += (int)pModel;
4481 if ( v2 * v2 + v128 * v128 >= 400 ) 4441 if ( v2 * v2 + v128 * v128 >= 400 )
4482 { 4442 {
4483 v45 = stru_721530.uFaceID; 4443 if ( pParty->floor_face_pid != stru_721530.uFaceID && BYTE3(pODMFace->uAttributes) & 4 )
4484 if ( pParty->floor_face_pid != v45 && BYTE3(pODMFace->uAttributes) & 4 ) 4444 {
4485 { 4445 pParty->floor_face_pid = stru_721530.uFaceID;
4486 pParty->floor_face_pid = v45; 4446 v103 = pODMFace->sCogTriggeredID; //
4487 v103 = pODMFace->sCogTriggeredID; 4447 }
4488 } 4448 v2 = (unsigned __int64)(58500i64 * v2) >> 16;
4489 v2 = (unsigned __int64)(58500i64 * v2) >> 16; 4449 pModel = (BSPModel *)58500;
4490 pModel = (BSPModel *)58500; 4450 v128 = (unsigned __int64)(58500i64 * v128) >> 16;
4491 v128 = (unsigned __int64)(58500i64 * v128) >> 16; 4451 v122 = (unsigned __int64)(58500i64 * pParty->uFallSpeed) >> 16;
4492 v122 = (unsigned __int64)(58500i64 * pParty->uFallSpeed) >> 16; 4452 //++v126;
4493 ++v126; 4453 pParty->uFallSpeed = (unsigned __int64)(58500i64 * pParty->uFallSpeed) >> 16;
4494 pParty->uFallSpeed = (unsigned __int64)(58500i64 * pParty->uFallSpeed) >> 16; 4454 continue;
4495 continue; 4455 }
4496 }
4497 v2 = 0; 4456 v2 = 0;
4498 pParty->uFallSpeed = 0; 4457 pParty->uFallSpeed = 0;
4499 *(float *)&v128 = 0.0; 4458 *(float *)&v128 = 0.0;
4500 } 4459 }
4501 } 4460 }
4502 //LABEL_234:
4503 v2 = (unsigned __int64)(58500i64 * v2) >> 16; 4461 v2 = (unsigned __int64)(58500i64 * v2) >> 16;
4504 pModel = (BSPModel *)58500; 4462 pModel = (BSPModel *)58500;
4505 v128 = (unsigned __int64)(58500i64 * v128) >> 16; 4463 v128 = (unsigned __int64)(58500i64 * v128) >> 16;
4506 v122 = (unsigned __int64)(58500i64 * pParty->uFallSpeed) >> 16; 4464 v122 = (unsigned __int64)(58500i64 * pParty->uFallSpeed) >> 16;
4507 ++v126;
4508 pParty->uFallSpeed = (unsigned __int64)(58500i64 * pParty->uFallSpeed) >> 16; 4465 pParty->uFallSpeed = (unsigned __int64)(58500i64 * pParty->uFallSpeed) >> 16;
4509 } 4466 }
4510 while ( v126 < 100 ); 4467
4511 4468 // /------------------------
4469 v122 = abs(pParty->vPosition.x - pX);
4470 uint pY_ = abs(pParty->vPosition.y - pY);
4471 v62 = abs(pParty->vPosition.z - pZ);
4512 if ( bWalkSound && pParty->walk_sound_timer <= 0 ) 4472 if ( bWalkSound && pParty->walk_sound_timer <= 0 )
4513 { 4473 {
4514 v122 = abs(pParty->vPosition.x - pX); 4474 pAudioPlayer->_4AA258(804);//stop sound
4515 v126 = abs(pParty->vPosition.y - pY); 4475 if ( party_running_flag && (!hovering || high_fall_flag) )
4516 v62 = abs(pParty->vPosition.z - pZ); 4476 {
4517 if ( integer_sqrt(v122 * v122 + v126 * v126 + v62 * v62) >= 8 ) 4477 if ( integer_sqrt(v122 * v122 + pY_ * pY_ + v62 * v62) >= 16 )
4518 {
4519 if ( party_running_flag && (!hovering || !high_fall_flag) )
4520 { 4478 {
4521 if ( !is_not_on_bmodel 4479 if ( !is_not_on_bmodel
4522 && !(BYTE1(pOutdoor->pBModels[pParty->floor_face_pid >> 9].pFaces[(pParty->floor_face_pid >> 3) & 0x3F].uAttributes) & 0x20) ) 4480 && !(BYTE1(pOutdoor->pBModels[pParty->floor_face_pid >> 9].pFaces[(pParty->floor_face_pid >> 3) & 0x3F].uAttributes) & 0x20) )
4523 pAudioPlayer->PlaySound(SOUND_RunAlong3DModel, 804, 1, -1, 0, 0, 0, 0);// 3D Model 4481 pAudioPlayer->PlaySound(SOUND_RunAlong3DModel, 804, 1, -1, 0, 0, 0, 0);// 3D Model
4524 else 4482 else
4525 { 4483 {
4526 v87 = pOutdoor->GetSoundIdByPosition(WorldPosToGridCellX(pParty->vPosition.x), WorldPosToGridCellZ(pParty->vPosition.y) - 1, 1); 4484 v87 = pOutdoor->GetSoundIdByPosition(WorldPosToGridCellX(pParty->vPosition.x), WorldPosToGridCellZ(pParty->vPosition.y) - 1, 1);
4527 pAudioPlayer->PlaySound((SoundID)v87, 804, 1, -1, 0, 0, 0, 0);// 4485 pAudioPlayer->PlaySound((SoundID)v87, 804, 1, -1, 0, 0, 0, 0);//
4528 } 4486 }
4529 } 4487 pParty->walk_sound_timer = 96;//
4530 else if ( party_walking_flag && (!hovering || !high_fall_flag) ) 4488 }
4489 }
4490 else if( party_walking_flag && (!hovering || high_fall_flag) )
4491 {
4492 if ( integer_sqrt(v122 * v122 + pY_ * pY_ + v62 * v62) >= 8 )
4531 { 4493 {
4532 if ( is_not_on_bmodel 4494 if ( is_not_on_bmodel
4533 || BYTE1(pOutdoor->pBModels[pParty->floor_face_pid >> 9].pFaces[(pParty->floor_face_pid >> 3) & 0x3F].uAttributes) & 0x20 ) 4495 || BYTE1(pOutdoor->pBModels[pParty->floor_face_pid >> 9].pFaces[(pParty->floor_face_pid >> 3) & 0x3F].uAttributes) & 0x20 )
4534 { 4496 {
4535 v87 = pOutdoor->GetSoundIdByPosition(WorldPosToGridCellX(pParty->vPosition.x), WorldPosToGridCellZ(pParty->vPosition.y) - 1, 0); 4497 v87 = pOutdoor->GetSoundIdByPosition(WorldPosToGridCellX(pParty->vPosition.x), WorldPosToGridCellZ(pParty->vPosition.y) - 1, 0);
4536 pAudioPlayer->PlaySound((SoundID)v87, 804, 1, -1, 0, 0, 0, 0);// 4498 pAudioPlayer->PlaySound((SoundID)v87, 804, 1, -1, 0, 0, 0, 0);//
4537 } 4499 }
4538 else 4500 else
4539 pAudioPlayer->PlaySound(SOUND_WalkAlong3DModel, 804, 1, -1, 0, 0, 0, 0);// 3D Model 4501 pAudioPlayer->PlaySound(SOUND_WalkAlong3DModel, 804, 1, -1, 0, 0, 0, 0);// 3D Model
4540 } 4502 pParty->walk_sound_timer = 144;//
4541 } 4503 }
4542 else 4504 }
4543 { 4505 }
4544 pAudioPlayer->_4AA258(804); 4506 if ( integer_sqrt(v122 * v122 + pY_ * pY_ + v62 * v62) < 8 )//
4545 pParty->walk_sound_timer = 64; 4507 pAudioPlayer->_4AA258(804);
4546 } 4508 //------------------------------------------------------------------------
4547 }
4548
4549 if ( !hovering || !high_fall_flag ) 4509 if ( !hovering || !high_fall_flag )
4550 pParty->uFlags &= ~PARTY_FLAGS_1_FALLING; 4510 pParty->uFlags &= ~PARTY_FLAGS_1_FALLING;
4551 else 4511 else
4552 pParty->uFlags |= PARTY_FLAGS_1_FALLING; 4512 pParty->uFlags |= PARTY_FLAGS_1_FALLING;
4553 v126 = WorldPosToGridCellX(pParty->vPosition.x); 4513 int pMap_X = WorldPosToGridCellX(pParty->vPosition.x);
4554 v65 = WorldPosToGridCellZ(pParty->vPosition.y) - 1; 4514 int pMap_Y = WorldPosToGridCellZ(pParty->vPosition.y) - 1;
4555 unsigned int v114_a = WorldPosToGridCellX(pX); 4515 unsigned int v114_a = WorldPosToGridCellX(pX);
4556 v66 = WorldPosToGridCellZ(pY) - 1; 4516 v66 = WorldPosToGridCellZ(pY) - 1;
4557 pModel = (BSPModel *)((~(unsigned int)pOutdoor->ActuallyGetSomeOtherTileInfo(v126, v65) >> 1) & 1); 4517 pModel = (BSPModel *)((~(unsigned int)pOutdoor->ActuallyGetSomeOtherTileInfo(pMap_X, pMap_Y) >> 1) & 1);
4558 v122 = (~(unsigned int)pOutdoor->ActuallyGetSomeOtherTileInfo(v114_a, v65) >> 1) & 1; 4518 v122 = (~(unsigned int)pOutdoor->ActuallyGetSomeOtherTileInfo(v114_a, pMap_Y) >> 1) & 1;
4559 v67 = pOutdoor->ActuallyGetSomeOtherTileInfo(v126, v66);
4560 v68 = 0; 4519 v68 = 0;
4561 v69 = (~(unsigned int)v67 >> 1) & 1; 4520 v69 = (~(unsigned int)pOutdoor->ActuallyGetSomeOtherTileInfo(pMap_X, v66) >> 1) & 1;
4562 if ( v114_a == v126 && v66 == v65 && v122 && v69 ) 4521 if ( v114_a == pMap_X && v66 == pMap_Y && v122 && v69 )
4563 v68 = 1; 4522 v68 = 1;
4564 if ( !is_not_on_bmodel ) 4523 if ( !is_not_on_bmodel )
4565 v68 = 1; 4524 v68 = 1;
4566 if ( v68 ) 4525 if ( v68 )
4567 { 4526 {
4568 v70 = pZ;
4569 v71 = pX;
4570 v72 = pY;
4571 //pParty->uFallSpeed = v121;
4572 v73 = pZ;
4573 pParty->vPosition.x = pX; 4527 pParty->vPosition.x = pX;
4574 pParty->vPosition.y = pY; 4528 pParty->vPosition.y = pY;
4575 pParty->vPosition.z = pZ; 4529 pParty->vPosition.z = pZ;
4576 pParty->field_6F0 = v113; 4530 pParty->field_6F0 = v113;
4577 if ( pZ > 8160 ) 4531 if ( pZ > 8160 )
4578 { 4532 {
4579 v73 = 8160; 4533 pZ = 8160;
4580 pParty->uFallStartY = 8160; 4534 pParty->uFallStartY = 8160;
4581 pParty->vPosition.z = 8160; 4535 pParty->vPosition.z = 8160;
4582 } 4536 }
4583 if ( !v103 4537 if ( !v103 //
4584 || (EventProcessor(v103, 0, 1), pParty->vPosition.x == v71) 4538 || (EventProcessor(v103, 0, 1), pParty->vPosition.x == pX)
4585 && pParty->vPosition.y == v72 4539 && pParty->vPosition.y == pY
4586 && (v73 = pParty->vPosition.z, pParty->vPosition.z == v70) ) 4540 && pParty->vPosition.z == pZ )
4587 { 4541 {
4588 if ( v73 < v111 ) 4542 if ( pParty->vPosition.z < v111 )
4589 { 4543 {
4590 pParty->uFallSpeed = 0; 4544 pParty->uFallSpeed = 0;
4591 v73 = v105; 4545 //v73 = v105;
4592 pParty->vPosition.z = v105; 4546 pParty->vPosition.z = v105;
4593 if ( pParty->uFallStartY - v70 > 512 && !bFeatherFall && v70 <= v105 && !bUnderwater )//Fall to the ground( ) 4547 if ( pParty->uFallStartY - pZ > 512 && !bFeatherFall && pZ <= v105 && !bUnderwater )//Fall to the ground( )
4594 { 4548 {
4595 if ( pParty->uFlags & PARTY_FLAGS_1_LANDING ) 4549 if ( pParty->uFlags & PARTY_FLAGS_1_LANDING )
4596 { 4550 {
4597 pParty->uFlags &= ~PARTY_FLAGS_1_LANDING; 4551 pParty->uFlags &= ~PARTY_FLAGS_1_LANDING;
4598 } 4552 }
4599 else 4553 else
4600 { 4554 {
4601 for ( uint i = 1; i <= 4; ++i ) 4555 for ( uint i = 1; i <= 4; ++i )
4602 { 4556 {
4603 v110 = pPlayers[i]->GetMaxHealth(); 4557 v110 = pPlayers[i]->GetMaxHealth();
4604 pPlayers[i]->ReceiveDamage((signed int)((pParty->uFallStartY - v70) * (unsigned __int64)(signed __int64)((double)v110 * 0.1)) / 256, 4558 pPlayers[i]->ReceiveDamage((signed int)((pParty->uFallStartY - pZ) * (unsigned __int64)(signed __int64)((double)v110 * 0.1)) / 256,
4605 DMGT_PHISYCAL); 4559 DMGT_PHISYCAL);
4606 v110 = 20 - pPlayers[i]->GetParameterBonus(pPlayers[i]->GetActualEndurance()); 4560 v110 = 20 - pPlayers[i]->GetParameterBonus(pPlayers[i]->GetActualEndurance());
4607 pPlayers[i]->SetRecoveryTime((signed __int64)((double)v110 * flt_6BE3A4_debug_recmod1 * 2.133333333333333)); 4561 pPlayers[i]->SetRecoveryTime((signed __int64)((double)v110 * flt_6BE3A4_debug_recmod1 * 2.133333333333333));
4608 } 4562 }
4609 v73 = pParty->vPosition.z; 4563 //v73 = pParty->vPosition.z;
4610 } 4564 }
4611 } 4565 }
4612 pParty->uFallStartY = v70; 4566 pParty->uFallStartY = pZ;
4613 } 4567 }
4614 if ( v102 && v73 < v109 ) 4568 if ( v102 && pParty->vPosition.z < ceiling_height )
4615 { 4569 {
4616 if ( (signed int)(pParty->uPartyHeight + v73) >= v109 ) 4570 if ( (signed int)(pParty->uPartyHeight + pParty->vPosition.z) >= ceiling_height )
4617 { 4571 {
4618 pParty->vPosition.z = v109 - pParty->uPartyHeight - 1; 4572 pParty->vPosition.z = ceiling_height - pParty->uPartyHeight - 1;
4619 pParty->field_6F0 = v109 - pParty->uPartyHeight - 1; 4573 pParty->field_6F0 = ceiling_height - pParty->uPartyHeight - 1;
4620 } 4574 }
4621 } 4575 }
4622 pParty->uFlags &= ~0x204; 4576 pParty->uFlags &= ~0x204;
4623 } 4577 }
4624 return; 4578 return;
4630 v77 = v122 != 0; 4584 v77 = v122 != 0;
4631 bool party_drowning_flag = false; 4585 bool party_drowning_flag = false;
4632 if ( !pParty->bFlying && high_fall_flag && !bWaterWalk ) 4586 if ( !pParty->bFlying && high_fall_flag && !bWaterWalk )
4633 { 4587 {
4634 if ( pModel ) 4588 if ( pModel )
4635 {
4636 v78 = v69 != 0; 4589 v78 = v69 != 0;
4637 } 4590 else
4638 else 4591 {
4639 { 4592 party_drowning_flag = true;
4640 party_drowning_flag = true; 4593 v78 = true;
4641 v78 = 1; 4594 }
4642 }
4643 } 4595 }
4644 else 4596 else
4645 v78 = 1; 4597 v78 = true;
4646 //LABEL_306: 4598
4647 if ( v77 ) 4599 if ( v77 )
4648 {
4649 pParty->vPosition.x = pX; 4600 pParty->vPosition.x = pX;
4650 }
4651 if ( v78 ) 4601 if ( v78 )
4652 {
4653 pParty->vPosition.y = pY; 4602 pParty->vPosition.y = pY;
4654 } 4603
4655 if ( v78 || v77) 4604 if ( v78 || v77)
4656 { 4605 {
4657 if ( bWaterWalk ) 4606 if ( bWaterWalk )
4658 { 4607 {
4659 pParty->uFlags &= ~PARTY_FLAGS_1_STANDING_ON_WATER; 4608 pParty->uFlags &= ~PARTY_FLAGS_1_STANDING_ON_WATER;
4675 else if ( bWalkSound && pParty->walk_sound_timer <= 0 ) 4624 else if ( bWalkSound && pParty->walk_sound_timer <= 0 )
4676 { 4625 {
4677 pAudioPlayer->_4AA258(804); 4626 pAudioPlayer->_4AA258(804);
4678 pParty->walk_sound_timer = 64; 4627 pParty->walk_sound_timer = 64;
4679 } 4628 }
4680 //LABEL_318: 4629
4681 v81 = pZ; 4630 v81 = pZ;
4682 v82 = pZ; 4631 v82 = pZ;
4683 pParty->vPosition.z = pZ; 4632 pParty->vPosition.z = pZ;
4684 if ( pZ > 8160 ) 4633 if ( pZ > 8160 )
4685 { 4634 {
4694 { 4643 {
4695 pTerrainHeight = GetTerrainHeightsAroundParty2(pParty->vPosition.x, pParty->vPosition.y, &v110, 1); 4644 pTerrainHeight = GetTerrainHeightsAroundParty2(pParty->vPosition.x, pParty->vPosition.y, &v110, 1);
4696 if ( pParty->vPosition.z <= pTerrainHeight + 1 )// +1 4645 if ( pParty->vPosition.z <= pTerrainHeight + 1 )// +1
4697 pParty->uFlags |= PARTY_FLAGS_1_WATER_DAMAGE; 4646 pParty->uFlags |= PARTY_FLAGS_1_WATER_DAMAGE;
4698 } 4647 }
4699 if ( !v103 4648
4649 if ( !v103//
4700 || (EventProcessor(v103, 0, 1), pParty->vPosition.x == pX) 4650 || (EventProcessor(v103, 0, 1), pParty->vPosition.x == pX)
4701 && pParty->vPosition.y == pY 4651 && pParty->vPosition.y == pY
4702 && (v82 = pParty->vPosition.z, pParty->vPosition.z == v81) ) 4652 && (v82 = pParty->vPosition.z, pParty->vPosition.z == v81) )
4703 { 4653 {
4704 if ( v82 < v111 ) 4654 if ( pParty->vPosition.z < v111 )
4705 { 4655 {
4706 v82 = v105; 4656 v82 = v105;
4707 pParty->uFallSpeed = 0; 4657 pParty->uFallSpeed = 0;
4708 pParty->vPosition.z = v105; 4658 pParty->vPosition.z = v105;
4709 if ( pParty->uFallStartY - v81 > 512 && !bFeatherFall && v81 <= v105 && !bUnderwater )//Fall to the water( ) 4659 if ( pParty->uFallStartY - v81 > 512 && !bFeatherFall && v81 <= v105 && !bUnderwater )//Fall to the water( )
4725 v82 = pParty->vPosition.z; 4675 v82 = pParty->vPosition.z;
4726 } 4676 }
4727 } 4677 }
4728 pParty->uFallStartY = v81; 4678 pParty->uFallStartY = v81;
4729 } 4679 }
4730 if ( v102 && v82 < v109 && (signed int)(pParty->uPartyHeight + v82) >= v109 ) 4680 if ( v102 && v82 < ceiling_height && (signed int)(pParty->uPartyHeight + v82) >= ceiling_height )
4731 { 4681 {
4732 pParty->vPosition.z = v82 + pParty->uPartyHeight - v109 + 1; 4682 pParty->vPosition.z = v82 + pParty->uPartyHeight - ceiling_height + 1;
4733 pParty->field_6F0 = v82 + pParty->uPartyHeight - v109 + 1; 4683 pParty->field_6F0 = v82 + pParty->uPartyHeight - ceiling_height + 1;
4734 } 4684 }
4735 } 4685 }
4736 } 4686 }
4737 //----- (0046D8E3) -------------------------------------------------------- 4687 //----- (0046D8E3) --------------------------------------------------------
4738 int GetCeilingHeight(int Party_X, signed int Party_Y, int Party_ZHeight, int pFaceID) 4688 int GetCeilingHeight(int Party_X, signed int Party_Y, int Party_ZHeight, int pFaceID)