- implement InitPedestrians, DestroyPedestrian(s), ActivatePlayerPedestrian, SetTannerPosition

- little fixes
This commit is contained in:
Ilya Shurumov 2020-05-15 14:12:13 +06:00
parent 9b48cb9b20
commit 6270cbea4f
20 changed files with 343 additions and 253 deletions

View File

@ -341,7 +341,7 @@ int decodeSound(unsigned char* iData, int soundSize, short* oData, int* loopStar
}
if (breakOnEnd)
return loopEnd;
return k;
}
}

View File

@ -19,6 +19,7 @@
#include "CUTSCENE.H"
#include "CONVERT.H"
#include "PAUSE.H"
#include "PLAYERS.H"
#include "../ASM/ASMTEST.H"
#include "GTEREG.H"

View File

@ -15,6 +15,7 @@
#include "REPLAYS.H"
#include "CONVERT.H"
#include "SPOOL.H"
#include "PLAYERS.H"
char speedLimits[3] = { 56, 97, 138 };

View File

@ -17,6 +17,7 @@
#include "MISSION.H"
#include "DRAW.H"
#include "MODELS.H"
#include "PLAYERS.H"
#include "../ASM/ASMTEST.H"
#include "GTEREG.H"

View File

@ -20,6 +20,7 @@
#include "ENVSOUND.H"
#include "CONVERT.H"
#include "XMPLAY.H"
#include "PLAYERS.H"
typedef void(*envsoundfunc)(struct __envsound *ep /*$s1*/, struct __envsoundinfo *E /*$a1*/, int pl /*$a2*/);

View File

@ -23,6 +23,7 @@
#include "SOUND.H"
#include "GLAUNCH.H"
#include "SHADOW.H"
#include "PLAYERS.H"
#include "GTEREG.H"
#include "INLINE_C.H"

View File

@ -424,7 +424,6 @@ void ProcessLumps(char *lump_ptr, int lump_size)
/* WARNING: Unknown calling convention yet parameter storage is locked */
int SpoolLumpOffset;
SEATED_PEDESTRIANS* seated_pedestrian = NULL;
// [D]
void LoadGameLevel(void)

View File

@ -9,6 +9,7 @@
#include "CAMERA.H"
#include "GLAUNCH.H"
#include "MODELS.H"
#include "PLAYERS.H"
#include "STRINGS.H"

View File

@ -10,6 +10,7 @@
#include "OVERLAY.H"
#include "REPLAYS.H"
#include "PAUSE.H"
#include "PLAYERS.H"
// decompiled code
// original method signature:

View File

@ -142,11 +142,12 @@ int lastsay = -1;
int gCarWithABerm = -1;
int gCantDrive = 0;
int gDontResetCarDamage = 0;
int bMissionTitleFade = 0;
int gGotInStolenCar = 0;
int gCopCarTheftAttempted = 0;
int gLockPickingAttempted = 0;
int gDontResetCarDamage = 0;
int bMissionTitleFade = 0;
STOPCOPS gStopCops;
MR_MISSION Mission;
@ -303,7 +304,6 @@ void InitialiseMissionDefaults(void)
_MISSION* MissionLoadAddress;
_MISSION *MissionHeader;
_PLAYER player[8];
STREAM_SOURCE* PlayerStartInfo[8];
int numPlayersToCreate = 0;
int gStartOnFoot = 0;

View File

@ -14,7 +14,6 @@ extern GAMEMODE CurrentGameMode;
extern GAMEMODE WantedGameMode;
extern int gCurrentMissionNumber;
extern _MISSION *MissionHeader;
extern _PLAYER player[8];
extern STREAM_SOURCE* PlayerStartInfo[8];
extern int numPlayersToCreate;
extern int gStartOnFoot;
@ -30,6 +29,8 @@ extern int gBatterPlayer;
extern int bMissionTitleFade;
extern int g321GoDelay;
extern int gTannerActionNeeded;
extern int gGotInStolenCar;
extern int gCopCarTheftAttempted;
extern int gLockPickingAttempted;
extern char lockAllTheDoors;
extern int gCantDrive;

View File

@ -13,6 +13,7 @@
#include "PEDEST.H"
#include "SPOOL.H"
#include "CELL.H"
#include "PLAYERS.H"
#include "MAIN.H"

View File

@ -11,6 +11,7 @@
#include "CUTSCENE.H"
#include "CARS.H"
#include "PRES.H"
#include "PLAYERS.H"
COLOUR_BAND felonyColour[3] =
{

View File

@ -5,6 +5,7 @@
#include "SYSTEM.H"
#include "MISSION.H"
#include "MDRAW.H"
#include "PLAYERS.H"
#include "STRINGS.H"

View File

@ -1,11 +1,22 @@
#include "THISDUST.H"
#include "PEDEST.H"
#include "PLAYERS.H"
#include "MISSION.H"
#include "OBJCOLL.H"
#include "COSMETIC.H"
#include "MAIN.H"
#include "DR2ROADS.H"
#include "MOTION_C.H"
#include "CONVERT.H"
#include "GAMESND.H"
#include "SOUND.H"
#include "PAD.H"
#include "STRINGS.H"
MODEL* pmTannerModels[17] = { 0 };
typedef void(*pedFunc)(PEDESTRIAN *pPed);
void PedDoNothing(PEDESTRIAN *pPed);
void PedUserWalker(PEDESTRIAN *pPed);
void PedUserRunner(PEDESTRIAN *pPed);
@ -26,15 +37,40 @@ pedFunc fpPedPersonalityFunctions[] = {
PedGetInCar, PedGetOutCar,
PedCarryOutAnimation,
CivPedDoNothing, CivPedWalk, CivPedSit, CivPedJump,
PedPressButton, TannerSitDown, CopStand, CivGetIn };
PedPressButton, TannerSitDown, CopStand, CivGetIn
};
VECTOR tannerLookAngle = { 0, 0, 0, 0 };
int tannerTurnMax = 16;
int tannerTurnStep = 4;
long force[4] = { 0x9000, 0, 0, 0 };
long point[4] = { 0, 0, 0x5A, 0 };
int bKillTanner = 0;
SEATED_PEDESTRIANS *seated_pedestrian; // lump
int seated_count;
int maxSeated;
static int numTannerPeds = 0;
static int numCopPeds = 0;
int pinginPedAngle = 0;
PEDESTRIAN pedestrians[28];
PEDESTRIAN *pUsedPeds; // linked list of pedestrians
PEDESTRIAN *pFreePeds;
int max_pedestrians;
int num_pedestrians;
char ping_in_pedestrians = 0;
int tannerTurn = 0;
int bKilled = 0;
int bReverseAnimation = 0;
int iIdleTimer = 0;
// decompiled code
// original method signature:
// void /*$ra*/ IHaveThePower()
@ -414,30 +450,26 @@ void InitTanner(void)
/* end block 4 */
// End Line: 11523
// [D]
void SetTannerPosition(VECTOR *pVec)
{
UNIMPLEMENTED();
/*
PEDESTRIAN **ppPVar1;
PEDESTRIAN *pPVar2;
PEDESTRIAN *pPed;
pPVar2 = pUsedPeds;
if (pUsedPeds != (PEDESTRIAN *)0x0) {
do {
if (pPVar2->pedType == TANNER_MODEL) {
(pPVar2->position).vx = pVec->vx;
(pPVar2->position).vy = -pVec->vy;
(pPVar2->position).vz = pVec->vz;
player.pos[0] = pVec->vx;
player.pos[1] = pVec->vy;
player.pos[2] = pVec->vz;
}
ppPVar1 = &pPVar2->pNext;
pPVar2 = *ppPVar1;
} while (*ppPVar1 != (PEDESTRIAN *)0x0);
pPed = pUsedPeds;
while(pPed)
{
if (pPed->pedType == TANNER_MODEL)
{
pPed->position.vx = pVec->vx;
pPed->position.vy = -pVec->vy;
pPed->position.vz = pVec->vz;
player[0].pos[0] = pVec->vx;
player[0].pos[1] = pVec->vy;
player[0].pos[2] = pVec->vz;
}
pPed = pPed->pNext;
}
return;
*/
}
@ -478,54 +510,64 @@ void SetTannerPosition(VECTOR *pVec)
/* WARNING: Unknown calling convention yet parameter storage is locked */
// [D]
void InitPedestrians(void)
{
UNIMPLEMENTED();
/*
short sVar1;
SEATED_PEDESTRIANS *pSVar2;
int iVar3;
undefined4 *puVar4;
undefined4 *puVar5;
undefined4 *puVar6;
PEDESTRIAN *pPVar3;
PEDESTRIAN *pPVar5;
PEDESTRIAN *pPVar6;
pSVar2 = seated_pedestrian;
puVar5 = &pedestrians;
memset(&pedestrians, 0, 0xa10);
int loop;
SEATED_PEDESTRIANS *seatedptr;
memset(pedestrians, 0, sizeof(pedestrians));
DestroyPedestrians();
puVar6 = &DAT_000d8414;
puVar4 = &DAT_000d8470;
iVar3 = 0x19;
pedestrians = &DAT_000d8414;
loop = 25;
pedestrians[0].pNext = &pedestrians[1];
pPVar5 = pedestrians + 2;
pPVar3 = pedestrians;
pPVar6 = pedestrians;
do {
*(undefined4 **)(puVar6 + 1) = puVar5;
puVar5 = puVar5 + 0x17;
*(undefined4 **)puVar6 = puVar4;
puVar6 = puVar6 + 0x17;
iVar3 = iVar3 + -1;
puVar4 = puVar4 + 0x17;
} while (-1 < iVar3);
DAT_000d8d6c = 0;
DAT_000d8d70 = &DAT_000d8d10;
pUsedPeds = (PEDESTRIAN *)0x0;
pFreePeds = (PEDESTRIAN *)&pedestrians;
pPVar3->pPrev = pPVar6++;
pPVar3->pNext = pPVar5++;
pPVar3++;
loop--;
} while (-1 < loop);
pedestrians[27].pNext = NULL;
pedestrians[27].pPrev = &pedestrians[26];
pUsedPeds = NULL;
pFreePeds = pedestrians;
seated_count = 0;
if (pSVar2 != (SEATED_PEDESTRIANS *)0x0) {
sVar1 = pSVar2->rotation;
while (sVar1 != 9999) {
pSVar2->index = '\0';
sVar1 = pSVar2[1].rotation;
seated_count = seated_count + 1;
pSVar2 = pSVar2 + 1;
seatedptr = seated_pedestrian;
if (seatedptr != NULL)
{
sVar1 = seatedptr->rotation;
while (sVar1 != 9999)
{
seatedptr->index = 0;
sVar1 = seatedptr[1].rotation;
seated_count++;
seatedptr++;
}
}
maxSeated = seated_count;
numTannerPeds = 0;
pinginPedAngle = 0;
pPlayerPed = (PEDESTRIAN *)0x0;
pPlayerPed = NULL;
seated_count = 0;
ping_in_pedestrians = '\x01';
return;*/
ping_in_pedestrians = 1;
}
@ -560,18 +602,15 @@ void InitPedestrians(void)
void DestroyPedestrians(void)
{
UNIMPLEMENTED();
/*
if (pUsedPeds != (PEDESTRIAN *)0x0) {
do {
if (pUsedPeds->pedType == TANNER_MODEL) {
numTannerPeds = numTannerPeds + -1;
}
DestroyPedestrian(pUsedPeds);
} while (pUsedPeds != (PEDESTRIAN *)0x0);
}
while (pUsedPeds)
{
if (pUsedPeds->pedType == TANNER_MODEL)
numTannerPeds--;
DestroyPedestrian(pUsedPeds);
};
num_pedestrians = 0;
return;*/
}
@ -660,43 +699,46 @@ void DestroyCivPedestrians(void)
/* end block 3 */
// End Line: 8581
// [D]
void DestroyPedestrian(PEDESTRIAN *pPed)
{
UNIMPLEMENTED();
/*
PEDESTRIAN *pPVar1;
if ((pPed->flags & 8U) != 0)
numCopPeds--;
pPVar1 = pUsedPeds;
if ((pPed->flags & 8U) != 0) {
numCopPeds = numCopPeds + -1;
}
pPed->flags = 0;
(pPed->dir).vz = 0;
(pPed->dir).vy = 0;
(pPed->dir).vx = 0;
if (pPed == pPVar1) {
pPed->dir.vz = 0;
pPed->dir.vy = 0;
pPed->dir.vx = 0;
if (pPed == pUsedPeds)
{
pUsedPeds = pPed->pNext;
pUsedPeds->pPrev = (PEDESTRIAN *)0x0;
if(pUsedPeds) // [A] is this valid? Or it was by Reflections?
pUsedPeds->pPrev = NULL;
pPed->pNext = pFreePeds;
pFreePeds->pPrev = pPed;
}
else {
else
{
pPed->pPrev->pNext = pPed->pNext;
if (pPed->pNext != (PEDESTRIAN *)0x0) {
if (pPed->pNext)
pPed->pNext->pPrev = pPed->pPrev;
}
pPed->pNext = pFreePeds;
pFreePeds->pPrev = pPed;
pPed->pPrev = (PEDESTRIAN *)0x0;
pPed->pPrev = NULL;
}
pFreePeds = pPed;
if ((pPed->type == PED_ACTION_CIVSIT) && (seated_pedestrian[(byte)pPed->seat_index].index != '\0')
) {
seated_pedestrian[(byte)pPed->seat_index].index = '\0';
}
pPed->doing_turn = '\0';
num_pedestrians = num_pedestrians + -1;
return;*/
if (pPed->type == PED_ACTION_CIVSIT)
seated_pedestrian[pPed->seat_index].index = 0; // [A] removed check
pPed->doing_turn = 0;
num_pedestrians--;
}
@ -763,194 +805,226 @@ void DestroyPedestrian(PEDESTRIAN *pPed)
/* WARNING: Type propagation algorithm not settling */
// [D]
int ActivatePlayerPedestrian(_CAR_DATA *pCar, char *padId, int direction, long(*position)[4], int playerType)
{
UNIMPLEMENTED();
return 0;
/*
undefined *puVar1;
int iVar2;
int iVar3;
int side;
int dir;
PEDESTRIAN *pedptr;
uint uVar3;
int iVar4;
long lVar5;
int iVar6;
int playerId;
long lVar7;
int iVar8;
VECTOR *pos;
VECTOR local_48;
uint local_38;
long local_34;
uint local_30;
int local_2c;
VECTOR v;
long y;
long d;
local_38 = playerType & 0xff;
bReverseAnimation = 0;
iIdleTimer = 0;
if (padId == (char *)0x0) {
iVar6 = 0;
if (padId == NULL)
{
playerId = 0;
}
else {
iVar2 = (int)*padId;
iVar6 = -iVar2;
if (-1 < iVar2) {
iVar6 = iVar2;
}
else
{
iVar3 = (int)*padId;
playerId = -iVar3;
if (iVar3 > -1)
playerId = iVar3;
pedptr = pUsedPeds;
if (pUsedPeds != (PEDESTRIAN *)0x0) {
if (pUsedPeds != NULL)
{
do {
if ((int)pedptr->padId == iVar2) {
(&player)[iVar6].pPed = pedptr;
if (pedptr->padId == iVar3)
{
player[playerId].pPed = pedptr;
return 0;
}
pedptr = pedptr->pNext;
} while (pedptr != (PEDESTRIAN *)0x0);
} while (pedptr != NULL);
}
}
if (pCar == (_CAR_DATA *)0x0) {
iVar8 = (*position)[0];
iVar4 = (*position)[2];
iVar2 = 1;
local_30 = direction;
if (pCar == NULL)
{
v.vx = (*position)[0];
v.vz = (*position)[2];
iVar3 = 1;
d = direction;
y = 0;
}
else {
local_34 = (pCar->hd).where.t[1];
iVar8 = (pCar->hd).where.t[0];
iVar4 = (pCar->hd).where.t[2];
local_30 = (pCar->hd).direction;
iVar2 = (int)car_cosmetics[(byte)(pCar->ap).model].colBox.vx;
else
{
v.vx = pCar->hd.where.t[0];
v.vz = pCar->hd.where.t[2];
y = pCar->hd.where.t[1];
d = pCar->hd.direction;
iVar3 = car_cosmetics[pCar->ap.model].colBox.vx;
}
iVar2 = iVar2 + 0x5a;
if (7 < numTannerPeds) {
iVar3 += 90;
if (7 < numTannerPeds)
{
bReverseAnimation = 0;
iIdleTimer = 0;
return 0;
}
uVar3 = local_30 & 0xfff;
local_48.vy = local_34;
lVar5 = iVar4 + (iVar2 * rcossin_tbl[uVar3 * 2] >> 0xc);
lVar7 = iVar8 - (iVar2 * rcossin_tbl[uVar3 * 2 + 1] >> 0xc);
local_2c = local_30 - 0x800;
local_48.vx = lVar7;
local_48.vz = lVar5;
if (pCar != (_CAR_DATA *)0x0) {
side = QuickBuildingCollisionCheck(&local_48, local_2c, 10, 10, 10);
if ((side != 0) || (side = TannerCarCollisionCheck(&local_48, local_30, 1), side != 0)) {
dir = d - 0x800;
v.vy = y;
v.vx -= (iVar3 * rcossin_tbl[(d & 0xfffU) * 2 + 1] >> 0xc);
v.vz += (iVar3 * rcossin_tbl[(d & 0xfffU) * 2] >> 0xc);
side = 0;
if (pCar != NULL)
{
if (QuickBuildingCollisionCheck(&v, dir, 10, 10, 10) != 0 || TannerCarCollisionCheck(&v, d, 1) != 0)
{
side = 1;
local_48.vy = local_34;
lVar7 = iVar8 - (-iVar2 * (int)rcossin_tbl[uVar3 * 2 + 1] >> 0xc);
lVar5 = iVar4 + (-iVar2 * (int)rcossin_tbl[uVar3 * 2] >> 0xc);
local_48.vx = lVar7;
local_48.vz = lVar5;
iVar2 = QuickBuildingCollisionCheck(&local_48, local_2c, 10, 10, 10);
if (iVar2 != 0) {
v.vy = y;
v.vx -= (-iVar3 * rcossin_tbl[(d & 0xfffU) * 2 + 1] >> 0xc);
v.vz += (-iVar3 * rcossin_tbl[(d & 0xfffU) * 2] >> 0xc);
iVar3 = QuickBuildingCollisionCheck(&v, dir, 10, 10, 10);
if (iVar3 != 0)
return 0;
}
iVar2 = TannerCarCollisionCheck(&local_48, local_30, 1);
if (iVar2 != 0) {
iVar3 = TannerCarCollisionCheck(&v, d, 1);
if (iVar3 != 0)
return 0;
}
goto LAB_0006e908;
}
}
side = 0;
LAB_0006e908:
pedptr = CreatePedestrian();
numTannerPeds = numTannerPeds + 1;
if (padId == (char *)0x0) {
pedptr->padId = '\0';
}
else {
numTannerPeds++;
if (padId == NULL)
pedptr->padId = 0;
else
pedptr->padId = *padId;
}
pos = (VECTOR *)&pedptr->position;
if (pedptr == (PEDESTRIAN *)0x0) {
pos = (VECTOR *)&DAT_00000014;
while (FrameCnt != 0x78654321) {
if (pedptr == NULL)
{
pos = NULL;
while (FrameCnt != 0x78654321)
{
trap(0x400);
}
}
if (pCar == (_CAR_DATA *)0x0) {
else
pos = (VECTOR *)&pedptr->position;
if (pCar == NULL)
{
pedptr->type = PED_ACTION_BACK;
puVar1 = fpPedPersonalityFunctions;
pedptr->fpAgitatedState = (_func_2 *)0x0;
pedptr->fpRestState = puVar1;
pedptr->fpAgitatedState = NULL;
pedptr->fpRestState = fpPedPersonalityFunctions[0];
}
else {
else
{
pedptr->type = PED_ACTION_GETOUTCAR;
pedptr->fpRestState = fpPedPersonalityFunctions;
pedptr->fpAgitatedState = PTR_PedGetOutCar_000a1680;
pedptr->fpRestState = fpPedPersonalityFunctions[0];
pedptr->fpAgitatedState = PedGetOutCar;
}
(pedptr->position).vx = lVar7;
(pedptr->position).vz = lVar5;
if (pCar != (_CAR_DATA *)0x0) {
(pedptr->position).vy = (pCar->hd).where.t[1];
}
iVar2 = MapHeight(pos);
(pedptr->position).vy = -0x82 - iVar2;
(pedptr->dir).vz = 0;
(pedptr->dir).vx = 0;
pedptr->position.vx = v.vx;
pedptr->position.vz = v.vz;
if (pCar != NULL)
pedptr->position.vy = (pCar->hd).where.t[1];
pedptr->position.vy = -130 - MapHeight(pos);
pedptr->dir.vz = 0;
pedptr->dir.vx = 0;
pedptr->dir.vy = dir;
pedptr->head_rot = 0;
(pedptr->dir).vy = (short)local_2c;
pPlayerPed = pedptr;
(&player)[iVar6].headTimer = '\0';
pedptr->pedType = (PED_MODEL_TYPES)local_38;
player[playerId].headTimer = 0;
pedptr->pedType = (PED_MODEL_TYPES)playerType;
SetupPedestrian(pedptr);
if (pCar == (_CAR_DATA *)0x0) {
(&player)[iVar6].cameraView = '\0';
(&player)[iVar6].headPos = 0;
(&player)[iVar6].headTarget = 0;
(&player)[iVar6].headTimer = '\0';
(&player)[iVar6].playerType = '\x02';
(&player)[iVar6].cameraAngle = local_2c;
(&player)[iVar6].cameraCarId = -1;
(&player)[iVar6].worldCentreCarId = -1;
(&player)[iVar6].pos[0] = (pedptr->position).vx;
(&player)[iVar6].pos[1] = (pedptr->position).vy;
lVar5 = (pedptr->position).vz;
(&player)[iVar6].spoolXZ = pos;
(&player)[iVar6].pPed = pedptr;
(&player)[iVar6].onGrass = '\0';
(&player)[iVar6].dir = local_30;
(&player)[iVar6].pos[2] = lVar5;
pedptr->frame1 = '\0';
pedptr->speed = '\0';
if (local_38 == 2) {
if (gCurrentMissionNumber == 9) {
pedptr->pallet = 'D';
if (pCar == NULL)
{
player[playerId].cameraView = 0;
player[playerId].headPos = 0;
player[playerId].headTarget = 0;
player[playerId].headTimer = 0;
player[playerId].playerType = 2;
player[playerId].cameraAngle = dir;
player[playerId].cameraCarId = -1;
player[playerId].worldCentreCarId = -1;
player[playerId].pos[0] = pedptr->position.vx;
player[playerId].pos[1] = pedptr->position.vy;
player[playerId].pos[2] = pedptr->position.vz;
player[playerId].spoolXZ = pos;
player[playerId].pPed = pedptr;
player[playerId].onGrass = 0;
player[playerId].dir = d;
pedptr->frame1 = 0;
pedptr->speed = 0;
if (playerType == 2)
{
if (gCurrentMissionNumber == 9)
{
pedptr->pallet = 68;
}
else {
else
{
lVar5 = Random2(0);
lVar7 = Random2(0);
pedptr->pallet =
(char)lVar5 + (char)(lVar5 / 3) * -3 + ((char)lVar7 + (char)(lVar7 / 3) * -3) * '\x10';
pedptr->pallet = lVar5 - (lVar5 / 3) * 3 + (lVar7 - (lVar7 / 3) * 3) * 16;
}
}
}
else {
MakeTheCarShutUp('\0');
Start3DSoundVolPitch(-1, 6, 2, player.pos[0], player.pos[1], player.pos[2], 0, 0x1000);
else
{
MakeTheCarShutUp(0);
Start3DSoundVolPitch(-1, 6, 2, player[0].pos[0], player[0].pos[1], player[0].pos[2], 0, 0x1000);
SetupGetOutCar(pedptr, pCar, side);
pedptr->padId = '\0';
player.pPed = pedptr;
SetConfusedCar((int)player.playerCarId);
pedptr->padId = 0;
player[0].pPed = pedptr;
SetConfusedCar(player[0].playerCarId);
StopPadVibration(0);
StopPadVibration(1);
player.onGrass = '\0';
player[0].onGrass = 0;
}
iVar6 = gCurrentMissionNumber;
tannerTurn = 0;
gGotInStolenCar = 0;
bKillTanner = 0;
bKilled = 0;
pedptr->flags = pedptr->flags & 0xfffffffb;
if ((iVar6 == 0x17) && (local_38 != 0)) {
tannerTurn = 0x10;
(pedptr->dir).vy =
((pedptr->dir).vy - ((short)tannerTurnMax + 0x10) * (short)tannerTurnStep) + 0x126;
pedptr->flags = pedptr->flags & 0xfffffffb; // disable some flags?
if (gCurrentMissionNumber == 23 && playerType != 0)
{
tannerTurn = 16;
pedptr->dir.vy = (pedptr->dir.vy - (tannerTurnMax + 16) * tannerTurnStep) + 294;
}
return 1;*/
return 1;
}
@ -988,30 +1062,31 @@ LAB_0006e908:
/* WARNING: Unknown calling convention yet parameter storage is locked */
// [D]
PEDESTRIAN * CreatePedestrian(void)
{
UNIMPLEMENTED();
return 0;
/*
PEDESTRIAN *pPVar1;
PEDESTRIAN *pNewPed;
pNewPed = pFreePeds;
if (pFreePeds != NULL)
{
if (pFreePeds->pNext != NULL)
pFreePeds->pNext->pPrev = NULL;
pPVar1 = pFreePeds;
if (pFreePeds != (PEDESTRIAN *)0x0) {
if (pFreePeds->pNext != (PEDESTRIAN *)0x0) {
pFreePeds->pNext->pPrev = (PEDESTRIAN *)0x0;
}
pFreePeds = pFreePeds->pNext;
if (pUsedPeds != (PEDESTRIAN *)0x0) {
pUsedPeds->pPrev = pPVar1;
}
pPVar1->pPrev = (PEDESTRIAN *)0x0;
pPVar1->pNext = pUsedPeds;
num_pedestrians = num_pedestrians + 1;
pUsedPeds = pPVar1;
return pPVar1;
if (pUsedPeds != NULL)
pUsedPeds->pPrev = pNewPed;
pNewPed->pPrev = NULL;
pNewPed->pNext = pUsedPeds;
num_pedestrians++;
pUsedPeds = pNewPed;
return pNewPed;
}
return (PEDESTRIAN *)0x0;
*/
return NULL;
}

View File

@ -1,6 +1,7 @@
#ifndef PEDEST_H
#define PEDEST_H
extern SEATED_PEDESTRIANS *seated_pedestrian;
extern int bKillTanner;
extern void IHaveThePower(); // 0x0006DD34

View File

@ -31,6 +31,7 @@
// End Line: 151
PEDESTRIAN *pPlayerPed = NULL;
_PLAYER player[8];
// [D]
void InitPlayer(_PLAYER *locPlayer, _CAR_DATA *cp, char carCtrlType, int direction, long(*startPos)[4], int externModel, int palette, char *padid)

View File

@ -1,7 +1,7 @@
#ifndef PLAYERS_H
#define PLAYERS_H
extern _PLAYER player[8];
extern PEDESTRIAN *pPlayerPed;
extern void InitPlayer(struct _PLAYER *locPlayer, struct _CAR_DATA *cp, char carCtrlType, int direction, long (*startPos)[4], int externModel, int palette, char *padid); // 0x000739D8

View File

@ -13,7 +13,7 @@
#include "GLAUNCH.H"
#include "GAMESND.H"
#include "XAPLAY.H"
#include "PLAYERS.H"
#include <string.h>
#include <stdlib.h>

View File

@ -19308,12 +19308,15 @@ struct MR_TIMER // hashcode: 0xEA39F36E (dec: -365300882)
long count; // size=0, offset=8
};
struct PEDESTRIAN;
typedef void(*pedFunc)(PEDESTRIAN *pPed);
struct PEDESTRIAN // hashcode: 0xF569ED7C (dec: -177607300)
{
PEDESTRIAN *pNext; // size=92, offset=0
PEDESTRIAN *pPrev; // size=92, offset=4
void (*fpRestState)(); // size=0, offset=8
void (*fpAgitatedState)(); // size=0, offset=12
pedFunc fpRestState; // size=0, offset=8
pedFunc fpAgitatedState; // size=0, offset=12
char padId; // size=0, offset=16
enum PED_MODEL_TYPES pedType; // size=1, offset=17
VECTOR_NOPAD position; // size=12, offset=20
@ -19336,7 +19339,7 @@ struct PEDESTRIAN // hashcode: 0xF569ED7C (dec: -177607300)
enum PED_ACTION_TYPE type; // size=1, offset=89
};
enum PED_ACTION_TYPE // Hashcode: 0x3531DCAF (dec: 892460207)
enum PED_ACTION_TYPE : char // Hashcode: 0x3531DCAF (dec: 892460207)
{
PED_ACTION_WALK = 0,
PED_ACTION_RUN = 1,
@ -19356,7 +19359,7 @@ enum PED_ACTION_TYPE // Hashcode: 0x3531DCAF (dec: 892460207)
PED_ACTION_STOPPING = 15,
};
enum PED_MODEL_TYPES // Hashcode: 0x2858A7E3 (dec: 676898787)
enum PED_MODEL_TYPES : char // Hashcode: 0x2858A7E3 (dec: 676898787)
{
TANNER_MODEL = 0,
OTHER_MODEL = 1,