2020-03-27 21:47:29 +01:00
|
|
|
#include "THISDUST.H"
|
|
|
|
#include "AI.H"
|
2020-05-15 13:38:32 +02:00
|
|
|
#include "MISSION.H"
|
|
|
|
#include "COSMETIC.H"
|
2020-05-15 13:50:23 +02:00
|
|
|
#include "COP_AI.H"
|
|
|
|
#include "CARS.H"
|
|
|
|
#include "PLAYERS.H"
|
2020-03-27 21:47:29 +01:00
|
|
|
|
|
|
|
// decompiled code
|
|
|
|
// original method signature:
|
|
|
|
// void /*$ra*/ StoreGameFlags()
|
|
|
|
// line 275, offset 0x0001bbb8
|
|
|
|
/* begin block 1 */
|
|
|
|
// Start line: 615
|
|
|
|
/* end block 1 */
|
|
|
|
// End Line: 616
|
|
|
|
|
|
|
|
/* begin block 2 */
|
|
|
|
// Start line: 550
|
|
|
|
/* end block 2 */
|
|
|
|
// End Line: 551
|
|
|
|
|
|
|
|
/* begin block 3 */
|
|
|
|
// Start line: 616
|
|
|
|
/* end block 3 */
|
|
|
|
// End Line: 617
|
|
|
|
|
|
|
|
/* WARNING: Unknown calling convention yet parameter storage is locked */
|
|
|
|
|
|
|
|
void StoreGameFlags(void)
|
|
|
|
{
|
2020-04-04 06:49:28 +02:00
|
|
|
UNIMPLEMENTED();
|
|
|
|
/*
|
|
|
|
ReplayParameterPtr->weather = (uchar)gWeather;
|
|
|
|
ReplayParameterPtr->timeofday = (uchar)gTimeOfDay;
|
|
|
|
return;*/
|
2020-03-27 21:47:29 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// decompiled code
|
|
|
|
// original method signature:
|
|
|
|
// int /*$ra*/ TannerCanEnterCar(struct _CAR_DATA *cp /*$a0*/, int distToCarSq /*$a1*/)
|
|
|
|
// line 297, offset 0x0001bbe8
|
|
|
|
/* begin block 1 */
|
|
|
|
// Start line: 298
|
|
|
|
// Start offset: 0x0001BBE8
|
|
|
|
|
|
|
|
/* begin block 1.1 */
|
|
|
|
// Start line: 310
|
|
|
|
// Start offset: 0x0001BC7C
|
|
|
|
// Variables:
|
|
|
|
// struct SVECTOR *carCollBox; // $v0
|
|
|
|
// int carRange; // $a0
|
|
|
|
/* end block 1.1 */
|
|
|
|
// End offset: 0x0001BCCC
|
|
|
|
// End Line: 317
|
|
|
|
/* end block 1 */
|
|
|
|
// End offset: 0x0001BCD4
|
|
|
|
// End Line: 320
|
|
|
|
|
|
|
|
/* begin block 2 */
|
|
|
|
// Start line: 659
|
|
|
|
/* end block 2 */
|
|
|
|
// End Line: 660
|
|
|
|
|
|
|
|
/* begin block 3 */
|
|
|
|
// Start line: 660
|
|
|
|
/* end block 3 */
|
|
|
|
// End Line: 661
|
|
|
|
|
2020-05-15 13:38:32 +02:00
|
|
|
// [D]
|
2020-04-04 06:49:28 +02:00
|
|
|
int TannerCanEnterCar(_CAR_DATA *cp, int distToCarSq)
|
2020-03-27 21:47:29 +01:00
|
|
|
{
|
2020-04-04 06:49:28 +02:00
|
|
|
int iVar1;
|
|
|
|
int iVar2;
|
|
|
|
|
2020-05-15 13:38:32 +02:00
|
|
|
if ((cp->controlFlags & 1) != 0)
|
2020-04-04 06:49:28 +02:00
|
|
|
gCopCarTheftAttempted = 1;
|
2020-05-15 13:38:32 +02:00
|
|
|
|
|
|
|
|
|
|
|
if ((cp->controlType == 2 || cp->controlType == 7) &&
|
|
|
|
(cp->controlFlags & 1) == 0 &&
|
|
|
|
(cp->controlFlags & 2) == 0 &&
|
2020-05-15 13:50:23 +02:00
|
|
|
cp->hd.where.m[1][1] > 99) // not flipped over
|
2020-05-15 13:38:32 +02:00
|
|
|
{
|
|
|
|
iVar1 = cp->hd.wheel_speed / 4096;
|
|
|
|
|
|
|
|
if (iVar1 < 0)
|
2020-04-04 06:49:28 +02:00
|
|
|
iVar1 = -iVar1;
|
2020-05-15 13:38:32 +02:00
|
|
|
|
|
|
|
if (iVar1 < 3)
|
|
|
|
{
|
|
|
|
iVar1 = car_cosmetics[cp->ap.model].colBox.vx * 2;
|
2020-04-04 06:49:28 +02:00
|
|
|
iVar2 = iVar1 * iVar1;
|
2020-05-15 13:38:32 +02:00
|
|
|
|
|
|
|
if (5000 < iVar1)
|
2020-04-04 06:49:28 +02:00
|
|
|
iVar2 = 25000000;
|
2020-05-15 13:38:32 +02:00
|
|
|
|
2020-04-04 06:49:28 +02:00
|
|
|
return (uint)(iVar2 < distToCarSq) ^ 1;
|
|
|
|
}
|
|
|
|
}
|
2020-05-15 13:38:32 +02:00
|
|
|
|
|
|
|
return 0;
|
2020-03-27 21:47:29 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// decompiled code
|
|
|
|
// original method signature:
|
|
|
|
// int /*$ra*/ TannerStuckInCar(int doSpeedCheck /*$a0*/)
|
|
|
|
// line 324, offset 0x0001ba90
|
|
|
|
/* begin block 1 */
|
|
|
|
// Start line: 325
|
|
|
|
// Start offset: 0x0001BA90
|
|
|
|
// Variables:
|
|
|
|
// struct _CAR_DATA *cp; // $a2
|
|
|
|
/* end block 1 */
|
|
|
|
// End offset: 0x0001BBB8
|
|
|
|
// End Line: 341
|
|
|
|
|
|
|
|
/* begin block 2 */
|
|
|
|
// Start line: 648
|
|
|
|
/* end block 2 */
|
|
|
|
// End Line: 649
|
|
|
|
|
|
|
|
/* begin block 3 */
|
|
|
|
// Start line: 649
|
|
|
|
/* end block 3 */
|
|
|
|
// End Line: 650
|
|
|
|
|
2020-05-18 21:44:18 +02:00
|
|
|
// [D]
|
2020-03-27 21:47:29 +01:00
|
|
|
int TannerStuckInCar(int doSpeedCheck)
|
|
|
|
{
|
2020-04-04 06:49:28 +02:00
|
|
|
short *psVar1;
|
|
|
|
int iVar2;
|
|
|
|
int iVar3;
|
|
|
|
|
2020-05-18 21:44:18 +02:00
|
|
|
_CAR_DATA *cp = NULL;
|
2020-05-15 13:50:23 +02:00
|
|
|
|
|
|
|
if (NumPlayers < 2 && player[0].playerType == 1)
|
|
|
|
{
|
|
|
|
if (player[0].playerCarId < 0)
|
|
|
|
{
|
2020-04-04 06:49:28 +02:00
|
|
|
psVar1 = &pedestrianFelony;
|
|
|
|
}
|
2020-05-15 13:50:23 +02:00
|
|
|
else
|
|
|
|
{
|
|
|
|
cp = &car_data[player[0].playerCarId];
|
|
|
|
psVar1 = &cp->felonyRating;
|
2020-04-04 06:49:28 +02:00
|
|
|
}
|
2020-05-15 13:50:23 +02:00
|
|
|
|
|
|
|
if ((*psVar1 < 0x293 || player_position_known < 1) &&
|
2020-05-18 21:44:18 +02:00
|
|
|
cp &&
|
2020-05-15 13:50:23 +02:00
|
|
|
(cp->hd.wheel[1].surface & 7) != 1 &&
|
|
|
|
(cp->hd.wheel[3].surface & 7) != 1)
|
|
|
|
{
|
|
|
|
if (doSpeedCheck != 0)
|
|
|
|
{
|
|
|
|
iVar2 = cp->hd.wheel_speed / 4096;
|
|
|
|
|
|
|
|
if (iVar2 < 0)
|
2020-04-04 06:49:28 +02:00
|
|
|
iVar2 = -iVar2;
|
2020-05-15 13:50:23 +02:00
|
|
|
|
|
|
|
if (2 < iVar2)
|
2020-04-04 06:49:28 +02:00
|
|
|
return 1;
|
|
|
|
}
|
2020-05-15 13:50:23 +02:00
|
|
|
|
|
|
|
if (cp->hd.where.m[1][1] > 99 && lockAllTheDoors == 0)
|
|
|
|
{
|
2020-04-04 06:49:28 +02:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return 1;
|
2020-03-27 21:47:29 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|