- implement PlaceRoadBlockCops

This commit is contained in:
Ilya Shurumov 2020-07-05 22:56:30 +06:00
parent 09f8de7825
commit 98d493d599

View File

@ -247,7 +247,6 @@ void ProcessTannerPad(PEDESTRIAN *pPed, ulong pad, char PadSteer, char use_analo
int iVar3; int iVar3;
int iVar4; int iVar4;
_sdPlane *p_Var5; _sdPlane *p_Var5;
SEATED_PEDESTRIANS *pSVar6;
short sVar7; short sVar7;
uint uVar8; uint uVar8;
VECTOR vec; VECTOR vec;
@ -845,11 +844,9 @@ int ActivatePlayerPedestrian(_CAR_DATA *pCar, char *padId, int direction, long(*
int side; int side;
int dir; int dir;
PEDESTRIAN *pedptr; PEDESTRIAN *pedptr;
int iVar4;
long lVar5; long lVar5;
int playerId; int playerId;
long lVar7; long lVar7;
int iVar8;
VECTOR *pos; VECTOR *pos;
VECTOR v; VECTOR v;
long y; long y;
@ -1181,97 +1178,89 @@ PEDESTRIAN * CreatePedestrian(void)
/* WARNING: Unknown calling convention yet parameter storage is locked */ /* WARNING: Unknown calling convention yet parameter storage is locked */
// [D]
void PlaceRoadBlockCops(void) void PlaceRoadBlockCops(void)
{ {
UNIMPLEMENTED();
/*
short sVar1; short sVar1;
int iVar2; int iVar2;
uint uVar3; int iVar3;
_CAR_DATA **pp_Var4; uint uVar4;
_CAR_DATA *p_Var5; _CAR_DATA **pp_Var5;
int iVar6; _CAR_DATA *p_Var6;
int iVar7; int a;
int iVar8; int iVar8;
_CAR_DATA *pCar;
int iVar9; int iVar9;
undefined4 uVar10; int iVar10;
int *piVar11; _CAR_DATA *pCopCars[16];
int iVar12; VECTOR vert;
int iVar13; long disp[4];
_CAR_DATA *local_98[16]; long dir[4];
int local_58;
undefined4 local_54;
int local_50;
long local_48;
int local_44;
int local_40;
int local_38;
undefined4 local_34;
int local_30;
iVar13 = 0; iVar10 = 0;
if (numCopPeds < 8) { if (numCopPeds < 8)
p_Var5 = car_data; {
pp_Var4 = local_98; p_Var6 = car_data;
pp_Var5 = pCopCars;
do { do {
if ((p_Var5->controlFlags & 2) != 0) { if ((p_Var6->controlFlags & 2) != 0)
*pp_Var4 = p_Var5; {
pp_Var4 = pp_Var4 + 1; *pp_Var5++ = p_Var6;
iVar13 = iVar13 + 1; iVar10++;
} }
p_Var5 = p_Var5 + 1; p_Var6++;
} while (p_Var5 < (_CAR_DATA *)0xd4698); } while (p_Var6 < car_data + 20);
if ((iVar13 != 0) && (iVar12 = 0, 0 < iVar13)) {
iVar6 = 0; if (iVar10 != 0 && 0 < iVar10)
{
iVar9 = 0;
a = 0;
do { do {
piVar11 = (int *)((int)local_98 + iVar6); pCar = pCopCars[iVar9];
uVar10 = *(undefined4 *)(*piVar11 + 0x68);
local_54 = 0; a = (pCar->hd).direction;
local_58 = 0; sVar1 = car_cosmetics[pCar->ap.model].colBox.vx;
local_50 = 0x1000; iVar2 = rsin(a);
sVar1 = car_cosmetics[*(byte *)(*piVar11 + 0x177)].colBox.vx; iVar3 = rcos(a);
iVar6 = rsin(uVar10);
iVar6 = -(local_50 * iVar6 >> 0xc); disp[0] = pCar->hd.where.t[0] - player[0].pos[0];
iVar2 = rcos(uVar10); disp[1] = 0;
local_58 = iVar6; disp[2] = pCar->hd.where.t[2] - player[0].pos[2];
local_50 = local_50 * iVar2 >> 0xc;
local_48 = *(int *)(*piVar11 + 0x14) - player.pos[0];
local_34 = 0; a = car_cosmetics[pCar->ap.model].colBox.vx + 400;
local_44 = 0; iVar8 = car_cosmetics[pCar->ap.model].colBox.vz - 120;
local_38 = local_50;
local_30 = iVar6; if (FIXED(iVar3 * 0x1000) * disp[0] - FIXED(iVar2 * 0x1000) * disp[2] + 0x800 < 0)
local_40 = *(int *)(*piVar11 + 0x1c) - player.pos[2]; a = -a;
iVar8 = *piVar11;
iVar2 = (int)sVar1 + 400; uVar4 = pCar->hd.direction + 0x800U & 0xfff;
iVar9 = (int)car_cosmetics[*(byte *)(iVar8 + 0x177)].colBox.vz + -0x78; iVar3 = (int)rcossin_tbl[uVar4 * 2 + 1];
if (local_50 * local_48 + iVar6 * local_40 + 0x800 < 0) { iVar2 = (int)rcossin_tbl[uVar4 * 2];
iVar2 = -iVar2;
} disp[0] = pCar->hd.where.t[0] - (FIXED(a * iVar3) - FIXED(iVar8 * iVar2));
uVar3 = *(int *)(iVar8 + 0x68) + 0x800U & 0xfff; disp[1] = -pCar->hd.where.t[1];
iVar7 = (int)rcossin_tbl[uVar3 * 2 + 1]; disp[2] = pCar->hd.where.t[2] + FIXED(a * iVar2) + FIXED(iVar8 * iVar3);
iVar6 = (int)rcossin_tbl[uVar3 * 2];
local_48 = *(int *)(iVar8 + 0x14) - ((iVar2 * iVar7 >> 0xc) - (iVar9 * iVar6 >> 0xc)); if (CreatePedAtLocation((long(*)[4])disp, 12) != 0)
local_44 = -*(int *)(*piVar11 + 0x18); numCopPeds++;
local_40 = *(int *)(*piVar11 + 0x1c) + (iVar2 * iVar6 >> 0xc) + (iVar9 * iVar7 >> 0xc);
iVar6 = CreatePedAtLocation((long(*)[4])&local_48, 0xc); iVar3 = (int)rcossin_tbl[uVar4 * 2 + 1];
if (iVar6 != 0) { iVar2 = (int)rcossin_tbl[uVar4 * 2];
disp[0] = pCar->hd.where.t[0] - (FIXED(a * iVar3) - FIXED(-iVar8 * iVar2));
disp[1] = -pCar->hd.where.t[1];
disp[2] = pCar->hd.where.t[2] + FIXED(a * iVar2) + FIXED(-iVar8 * iVar3);
if (CreatePedAtLocation((long(*)[4])disp, 13) != 0)
numCopPeds = numCopPeds + 1; numCopPeds = numCopPeds + 1;
}
iVar8 = (int)rcossin_tbl[uVar3 * 2 + 1]; iVar9++;
iVar6 = (int)rcossin_tbl[uVar3 * 2]; a = iVar9 * 4;
local_48 = *(int *)(*piVar11 + 0x14) - ((iVar2 * iVar8 >> 0xc) - (-iVar9 * iVar6 >> 0xc)); } while (iVar9 < iVar10);
local_44 = -*(int *)(*piVar11 + 0x18);
local_40 = *(int *)(*piVar11 + 0x1c) + (iVar2 * iVar6 >> 0xc) + (-iVar9 * iVar8 >> 0xc);
iVar6 = CreatePedAtLocation((long(*)[4])&local_48, 0xd);
if (iVar6 != 0) {
numCopPeds = numCopPeds + 1;
}
iVar12 = iVar12 + 1;
iVar6 = iVar12 * 4;
} while (iVar12 < iVar13);
} }
} }
return;*/
} }
@ -1762,7 +1751,6 @@ _CAR_DATA *pCivCarToGetIn = NULL;
// [D] // [D]
void CivGetIn(PEDESTRIAN *pPed) // [A] UNUSED void CivGetIn(PEDESTRIAN *pPed) // [A] UNUSED
{ {
int iVar1;
uint uVar2; uint uVar2;
DRIVER2_CURVE *curve; DRIVER2_CURVE *curve;
DRIVER2_STRAIGHT *straight; DRIVER2_STRAIGHT *straight;
@ -2402,7 +2390,6 @@ void SetupGetOutCar(PEDESTRIAN *pPed, _CAR_DATA *pCar, int side)
// [D] // [D]
void SetupGetInCar(PEDESTRIAN *pPed) void SetupGetInCar(PEDESTRIAN *pPed)
{ {
_CAR_DATA *p_Var1;
short sVar2; short sVar2;
int iVar3; int iVar3;
uint uVar4; uint uVar4;
@ -2743,7 +2730,6 @@ void TannerCameraHandler(PEDESTRIAN *pPed)
// [D] // [D]
void TannerSitDown(PEDESTRIAN *pPed) void TannerSitDown(PEDESTRIAN *pPed)
{ {
uint uVar1;
int iVar2; int iVar2;
if (oldCamView != 2 && player[pPed->padId].cameraView == 2) if (oldCamView != 2 && player[pPed->padId].cameraView == 2)
@ -2875,7 +2861,6 @@ void AnimatePed(PEDESTRIAN *pPed)
{ {
PED_ACTION_TYPE PVar2; PED_ACTION_TYPE PVar2;
ushort uVar3; ushort uVar3;
bool bVar4;
int iVar5; int iVar5;
unsigned char bVar6; unsigned char bVar6;
uint uVar7; uint uVar7;
@ -3991,7 +3976,6 @@ void SetupCivPedWalk(PEDESTRIAN *pPed)
// [D] // [D]
void CivPedWalk(PEDESTRIAN *pPed) void CivPedWalk(PEDESTRIAN *pPed)
{ {
char cVar1;
short sVar2; short sVar2;
ushort uVar3; ushort uVar3;
uint uVar4; uint uVar4;
@ -4683,7 +4667,6 @@ SEATED_PEDESTRIANS * FindTannerASeat(PEDESTRIAN *pPed)
void add_seated(SEATED_PEDESTRIANS *seatedptr, int seat_index) void add_seated(SEATED_PEDESTRIANS *seatedptr, int seat_index)
{ {
PEDESTRIAN *pedptr; PEDESTRIAN *pedptr;
int iVar2;
long lVar3; long lVar3;
long lVar4; long lVar4;
@ -4963,7 +4946,6 @@ void BuildCarCollisionBox(void)
_CAR_DATA* CheckForCar(PEDESTRIAN *pedestrian) _CAR_DATA* CheckForCar(PEDESTRIAN *pedestrian)
{ {
int iVar1; int iVar1;
int iVar2;
int iVar3; int iVar3;
CAR_COLLISION_BOX *cb; CAR_COLLISION_BOX *cb;
_CAR_DATA **pp_Var4; _CAR_DATA **pp_Var4;