mirror of
https://github.com/GTAmodding/re3.git
synced 2024-12-25 20:45:40 +00:00
Reorganize CPed functions into their original cpp files
This commit is contained in:
parent
54214dd2c4
commit
fe40f65703
16 changed files with 17686 additions and 17665 deletions
|
@ -1578,3 +1578,102 @@ void
|
||||||
CPacManPickups::ResetPowerPillsCarriedByPlayer()
|
CPacManPickups::ResetPowerPillsCarriedByPlayer()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// --MIAMI: Done
|
||||||
|
void
|
||||||
|
CPed::CreateDeadPedMoney(void)
|
||||||
|
{
|
||||||
|
if (!CGame::nastyGame)
|
||||||
|
return;
|
||||||
|
|
||||||
|
int mi = GetModelIndex();
|
||||||
|
|
||||||
|
if ((mi >= MI_COP && mi <= MI_FIREMAN) || (CharCreatedBy == MISSION_CHAR && !bMoneyHasBeenGivenByScript) || bInVehicle)
|
||||||
|
return;
|
||||||
|
|
||||||
|
int money = m_nPedMoney;
|
||||||
|
if (money < 10)
|
||||||
|
return;
|
||||||
|
|
||||||
|
CVector pickupPos = GetPosition();
|
||||||
|
CPickups::CreateSomeMoney(pickupPos, money);
|
||||||
|
m_nPedMoney = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// --MIAMI: Done
|
||||||
|
void
|
||||||
|
CPed::CreateDeadPedWeaponPickups(void)
|
||||||
|
{
|
||||||
|
CVector pickupPos;
|
||||||
|
|
||||||
|
if (bInVehicle)
|
||||||
|
return;
|
||||||
|
|
||||||
|
for(int i = 0; i < TOTAL_WEAPON_SLOTS; i++) {
|
||||||
|
|
||||||
|
eWeaponType weapon = GetWeapon(i).m_eWeaponType;
|
||||||
|
int weaponAmmo = GetWeapon(i).m_nAmmoTotal;
|
||||||
|
if (weapon == WEAPONTYPE_UNARMED || weapon == WEAPONTYPE_DETONATOR || (weaponAmmo == 0 && !GetWeapon(i).IsTypeMelee()))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
int quantity = Min(weaponAmmo, AmmoForWeapon_OnStreet[weapon] / 2);
|
||||||
|
CreateDeadPedPickupCoors(&pickupPos.x, &pickupPos.y, &pickupPos.z);
|
||||||
|
pickupPos.z += 0.3f;
|
||||||
|
if (!CPickups::TryToMerge_WeaponType(pickupPos, weapon, PICKUP_ONCE_TIMEOUT, quantity, false)) {
|
||||||
|
CPickups::GenerateNewOne_WeaponType(pickupPos, weapon, PICKUP_ONCE_TIMEOUT, Min(weaponAmmo, quantity));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ClearWeapons();
|
||||||
|
}
|
||||||
|
|
||||||
|
// --MIAMI: Done
|
||||||
|
void
|
||||||
|
CPed::CreateDeadPedPickupCoors(float *x, float *y, float *z)
|
||||||
|
{
|
||||||
|
bool found = false;
|
||||||
|
CVector pickupPos;
|
||||||
|
|
||||||
|
#define NUMBER_OF_ATTEMPTS 32
|
||||||
|
for (int i = 0; i < NUMBER_OF_ATTEMPTS; i++) {
|
||||||
|
|
||||||
|
pickupPos = GetPosition();
|
||||||
|
pickupPos.x = 1.5f * Sin((CGeneral::GetRandomNumber() % 256)/256.0f * TWOPI) + GetPosition().x;
|
||||||
|
pickupPos.y = 1.5f * Cos((CGeneral::GetRandomNumber() % 256)/256.0f * TWOPI) + GetPosition().y;
|
||||||
|
pickupPos.z = CWorld::FindGroundZFor3DCoord(pickupPos.x, pickupPos.y, pickupPos.z, &found) + 0.5f;
|
||||||
|
|
||||||
|
if (!found)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
CVector pedPos = GetPosition();
|
||||||
|
pedPos.z += 0.3f;
|
||||||
|
|
||||||
|
CVector pedToPickup = pickupPos - pedPos;
|
||||||
|
float distance = pedToPickup.Magnitude();
|
||||||
|
|
||||||
|
// outer edge of pickup
|
||||||
|
distance = (distance + 0.4f) / distance;
|
||||||
|
CVector pickupPos2 = pedPos;
|
||||||
|
pickupPos2 += distance * pedToPickup;
|
||||||
|
|
||||||
|
if ((pickupPos - FindPlayerCoors()).Magnitude2D() > 2.0f || i > NUMBER_OF_ATTEMPTS / 2) {
|
||||||
|
|
||||||
|
if (i > NUMBER_OF_ATTEMPTS / 2 || !CPickups::TestForPickupsInBubble(pickupPos, 1.3f)) {
|
||||||
|
|
||||||
|
if (CWorld::GetIsLineOfSightClear(pickupPos2, pedPos,
|
||||||
|
true, i < NUMBER_OF_ATTEMPTS / 2, false, i < NUMBER_OF_ATTEMPTS / 2, false, false, false)) {
|
||||||
|
|
||||||
|
if (i > NUMBER_OF_ATTEMPTS / 2 || !CWorld::TestSphereAgainstWorld(pickupPos, 1.2f, nil, false, true, false, false, false, false)) {
|
||||||
|
*x = pickupPos.x;
|
||||||
|
*y = pickupPos.y;
|
||||||
|
*z = pickupPos.z;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
*x = GetPosition().x;
|
||||||
|
*y = GetPosition().y;
|
||||||
|
*z = GetPosition().z + 0.4f;
|
||||||
|
#undef NUMBER_OF_ATTEMPTS
|
||||||
|
}
|
|
@ -11,7 +11,6 @@
|
||||||
#include "HandlingMgr.h"
|
#include "HandlingMgr.h"
|
||||||
#include "CarCtrl.h"
|
#include "CarCtrl.h"
|
||||||
#include "PedType.h"
|
#include "PedType.h"
|
||||||
#include "PedStats.h"
|
|
||||||
#include "AnimManager.h"
|
#include "AnimManager.h"
|
||||||
#include "Game.h"
|
#include "Game.h"
|
||||||
#include "RwHelper.h"
|
#include "RwHelper.h"
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
|
|
||||||
#include "ClumpModelInfo.h"
|
#include "ClumpModelInfo.h"
|
||||||
#include "PedType.h"
|
#include "PedType.h"
|
||||||
#include "PedStats.h"
|
|
||||||
|
|
||||||
enum PedNode {
|
enum PedNode {
|
||||||
PED_TORSO = 0, // has no bone!
|
PED_TORSO = 0, // has no bone!
|
||||||
|
|
|
@ -420,6 +420,32 @@ CCivilianPed::ProcessControl(void)
|
||||||
Avoid();
|
Avoid();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// --MIAMI: Done
|
||||||
|
bool
|
||||||
|
CPed::RunToReportCrime(eCrimeType crimeToReport)
|
||||||
|
{
|
||||||
|
// They changed true into false to make this function unusable. So running to phone actually starts but first frame after that cancels it.
|
||||||
|
if (m_nPedState == PED_SEEK_POS)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
CVector pos = GetPosition();
|
||||||
|
int phoneId = gPhoneInfo.FindNearestFreePhone(&pos);
|
||||||
|
|
||||||
|
if (phoneId == -1)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
CPhone* phone = &gPhoneInfo.m_aPhones[phoneId];
|
||||||
|
if (phone->m_nState != PHONE_STATE_FREE)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
bRunningToPhone = true;
|
||||||
|
SetSeek(phone->m_vecPos, 0.3f);
|
||||||
|
SetMoveState(PEDMOVE_RUN);
|
||||||
|
m_phoneId = phoneId;
|
||||||
|
m_crimeToReportOnPhone = crimeToReport;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
const int32 gFrequencyOfAttractorAttempt = 11;
|
const int32 gFrequencyOfAttractorAttempt = 11;
|
||||||
const float gDistanceToSeekAttractors = 50.0f;
|
const float gDistanceToSeekAttractors = 50.0f;
|
||||||
const float gMaxDistanceToAttract = 10.0f;
|
const float gMaxDistanceToAttract = 10.0f;
|
||||||
|
|
23413
src/peds/Ped.cpp
23413
src/peds/Ped.cpp
File diff suppressed because it is too large
Load diff
|
@ -5,7 +5,7 @@
|
||||||
#include "Crime.h"
|
#include "Crime.h"
|
||||||
#include "EventList.h"
|
#include "EventList.h"
|
||||||
#include "PedIK.h"
|
#include "PedIK.h"
|
||||||
#include "PedStats.h"
|
#include "PedType.h"
|
||||||
#include "Physical.h"
|
#include "Physical.h"
|
||||||
#include "Weapon.h"
|
#include "Weapon.h"
|
||||||
#include "WeaponInfo.h"
|
#include "WeaponInfo.h"
|
||||||
|
@ -15,6 +15,7 @@
|
||||||
#define FEET_OFFSET 1.04f
|
#define FEET_OFFSET 1.04f
|
||||||
#define CHECK_NEARBY_THINGS_MAX_DIST 15.0f
|
#define CHECK_NEARBY_THINGS_MAX_DIST 15.0f
|
||||||
#define ENTER_CAR_MAX_DIST 30.0f
|
#define ENTER_CAR_MAX_DIST 30.0f
|
||||||
|
#define CAN_SEE_ENTITY_ANGLE_THRESHOLD DEGTORAD(60.0f)
|
||||||
|
|
||||||
class CAccident;
|
class CAccident;
|
||||||
class CObject;
|
class CObject;
|
||||||
|
@ -652,6 +653,7 @@ public:
|
||||||
CPed(uint32 pedType);
|
CPed(uint32 pedType);
|
||||||
~CPed(void);
|
~CPed(void);
|
||||||
|
|
||||||
|
void DeleteRwObject();
|
||||||
void SetModelIndex(uint32 mi);
|
void SetModelIndex(uint32 mi);
|
||||||
void ProcessControl(void);
|
void ProcessControl(void);
|
||||||
void Teleport(CVector);
|
void Teleport(CVector);
|
||||||
|
@ -701,7 +703,7 @@ public:
|
||||||
void CalculateNewOrientation(void);
|
void CalculateNewOrientation(void);
|
||||||
float WorkOutHeadingForMovingFirstPerson(float);
|
float WorkOutHeadingForMovingFirstPerson(float);
|
||||||
void CalculateNewVelocity(void);
|
void CalculateNewVelocity(void);
|
||||||
bool CanSeeEntity(CEntity*, float);
|
bool CanSeeEntity(CEntity*, float threshold = CAN_SEE_ENTITY_ANGLE_THRESHOLD);
|
||||||
void RestorePreviousObjective(void);
|
void RestorePreviousObjective(void);
|
||||||
void SetIdle(void);
|
void SetIdle(void);
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
|
@ -771,6 +773,7 @@ public:
|
||||||
void SetFall(int, AnimationId, uint8);
|
void SetFall(int, AnimationId, uint8);
|
||||||
void SetFlee(CEntity*, int);
|
void SetFlee(CEntity*, int);
|
||||||
void SetFlee(CVector2D const &, int);
|
void SetFlee(CVector2D const &, int);
|
||||||
|
void RemoveDrivebyAnims(void);
|
||||||
void RemoveInCarAnims(void);
|
void RemoveInCarAnims(void);
|
||||||
void CollideWithPed(CPed*);
|
void CollideWithPed(CPed*);
|
||||||
void SetDirectionToWalkAroundObject(CEntity*);
|
void SetDirectionToWalkAroundObject(CEntity*);
|
||||||
|
@ -907,7 +910,7 @@ public:
|
||||||
static void PedAnimShuffleCB(CAnimBlendAssociation *assoc, void *arg);
|
static void PedAnimShuffleCB(CAnimBlendAssociation *assoc, void *arg);
|
||||||
static void PedSetGetInCarPositionCB(CAnimBlendAssociation* assoc, void* arg);
|
static void PedSetGetInCarPositionCB(CAnimBlendAssociation* assoc, void* arg);
|
||||||
|
|
||||||
bool IsPlayer(void);
|
bool IsPlayer(void) const;
|
||||||
bool IsFemale(void) { return m_nPedType == PEDTYPE_CIVFEMALE || m_nPedType == PEDTYPE_PROSTITUTE; }
|
bool IsFemale(void) { return m_nPedType == PEDTYPE_CIVFEMALE || m_nPedType == PEDTYPE_PROSTITUTE; }
|
||||||
bool UseGroundColModel(void);
|
bool UseGroundColModel(void);
|
||||||
bool CanSetPedState(void);
|
bool CanSetPedState(void);
|
||||||
|
@ -927,7 +930,7 @@ public:
|
||||||
void SetStoredObjective(void);
|
void SetStoredObjective(void);
|
||||||
void SetLeader(CEntity* leader);
|
void SetLeader(CEntity* leader);
|
||||||
void SetPedStats(ePedStats);
|
void SetPedStats(ePedStats);
|
||||||
bool IsGangMember(void);
|
bool IsGangMember(void) const;
|
||||||
void Die(void);
|
void Die(void);
|
||||||
#ifdef GTA_TRAIN
|
#ifdef GTA_TRAIN
|
||||||
void EnterTrain(void);
|
void EnterTrain(void);
|
||||||
|
@ -953,7 +956,7 @@ public:
|
||||||
void UpdatePosition(void);
|
void UpdatePosition(void);
|
||||||
CObject *SpawnFlyingComponent(int, int8);
|
CObject *SpawnFlyingComponent(int, int8);
|
||||||
void SetCarJack_AllClear(CVehicle*, uint32, uint32);
|
void SetCarJack_AllClear(CVehicle*, uint32, uint32);
|
||||||
bool CanPedJumpThis(CEntity*, CVector*);
|
bool CanPedJumpThis(CEntity *unused, CVector *damageNormal = nil);
|
||||||
void SetNewAttraction(CPedAttractor* pAttractor, const CVector& pos, float, float, int);
|
void SetNewAttraction(CPedAttractor* pAttractor, const CVector& pos, float, float, int);
|
||||||
void ClearWaitState(void);
|
void ClearWaitState(void);
|
||||||
void Undress(const char*);
|
void Undress(const char*);
|
||||||
|
@ -983,7 +986,7 @@ public:
|
||||||
bool Driving(void) { return m_nPedState == PED_DRIVING; }
|
bool Driving(void) { return m_nPedState == PED_DRIVING; }
|
||||||
bool InVehicle(void) { return bInVehicle && m_pMyVehicle; } // True when ped is sitting/standing in vehicle, not in enter/exit state.
|
bool InVehicle(void) { return bInVehicle && m_pMyVehicle; } // True when ped is sitting/standing in vehicle, not in enter/exit state.
|
||||||
bool EnteringCar(void) { return m_nPedState == PED_ENTER_CAR || m_nPedState == PED_CARJACK; }
|
bool EnteringCar(void) { return m_nPedState == PED_ENTER_CAR || m_nPedState == PED_CARJACK; }
|
||||||
bool HasAttractor(void) { return m_attractor != nil; }
|
bool HasAttractor(void);
|
||||||
bool IsUseAttractorObjective(eObjective obj) {
|
bool IsUseAttractorObjective(eObjective obj) {
|
||||||
return obj == OBJECTIVE_GOTO_ATM_ON_FOOT || obj == OBJECTIVE_GOTO_ICE_CREAM_VAN_ON_FOOT ||
|
return obj == OBJECTIVE_GOTO_ATM_ON_FOOT || obj == OBJECTIVE_GOTO_ICE_CREAM_VAN_ON_FOOT ||
|
||||||
obj == OBJECTIVE_GOTO_PIZZA_ON_FOOT || obj == OBJECTIVE_GOTO_SEAT_ON_FOOT ||
|
obj == OBJECTIVE_GOTO_PIZZA_ON_FOOT || obj == OBJECTIVE_GOTO_SEAT_ON_FOOT ||
|
||||||
|
@ -992,7 +995,10 @@ public:
|
||||||
|
|
||||||
void ReplaceWeaponWhenExitingVehicle(void);
|
void ReplaceWeaponWhenExitingVehicle(void);
|
||||||
void RemoveWeaponWhenEnteringVehicle(void);
|
void RemoveWeaponWhenEnteringVehicle(void);
|
||||||
bool IsNotInWreckedVehicle();
|
bool IsNotInWreckedVehicle()
|
||||||
|
{
|
||||||
|
return m_pMyVehicle != nil && ((CEntity*)m_pMyVehicle)->GetStatus() != STATUS_WRECKED;
|
||||||
|
}
|
||||||
|
|
||||||
// My names. Inlined in VC
|
// My names. Inlined in VC
|
||||||
AnimationId GetFireAnimNotDucking(CWeaponInfo* weapon) {
|
AnimationId GetFireAnimNotDucking(CWeaponInfo* weapon) {
|
||||||
|
|
6954
src/peds/PedAI.cpp
Normal file
6954
src/peds/PedAI.cpp
Normal file
File diff suppressed because it is too large
Load diff
|
@ -152,13 +152,4 @@ CPed::Say(uint16 audio)
|
||||||
m_queuedSound = audio;
|
m_queuedSound = audio;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
CPed::Say(uint16 audio, int32 time)
|
|
||||||
{
|
|
||||||
if (m_delayedSoundID == -1) {
|
|
||||||
m_delayedSoundID = audio;
|
|
||||||
m_delayedSoundTimer = CTimer::GetTimeInMilliseconds() + time;
|
|
||||||
}
|
|
||||||
}
|
}
|
4235
src/peds/PedFight.cpp
Normal file
4235
src/peds/PedFight.cpp
Normal file
File diff suppressed because it is too large
Load diff
|
@ -1,120 +0,0 @@
|
||||||
#include "common.h"
|
|
||||||
|
|
||||||
#include "General.h"
|
|
||||||
#include "FileMgr.h"
|
|
||||||
#include "PedStats.h"
|
|
||||||
|
|
||||||
// --MIAMI: file done
|
|
||||||
|
|
||||||
CPedStats *CPedStats::ms_apPedStats[NUM_PEDSTATS];
|
|
||||||
|
|
||||||
void
|
|
||||||
CPedStats::Initialise(void)
|
|
||||||
{
|
|
||||||
int i;
|
|
||||||
|
|
||||||
debug("Initialising CPedStats...\n");
|
|
||||||
for(i = 0; i < NUM_PEDSTATS; i++){
|
|
||||||
ms_apPedStats[i] = new CPedStats;
|
|
||||||
ms_apPedStats[i]->m_type = PEDSTAT_PLAYER;
|
|
||||||
ms_apPedStats[i]->m_name[8] = 'R'; // WHAT?
|
|
||||||
ms_apPedStats[i]->m_fleeDistance = 20.0f;
|
|
||||||
ms_apPedStats[i]->m_headingChangeRate = 15.0f;
|
|
||||||
ms_apPedStats[i]->m_fear = 50;
|
|
||||||
ms_apPedStats[i]->m_temper = 50;
|
|
||||||
ms_apPedStats[i]->m_lawfulness = 50;
|
|
||||||
ms_apPedStats[i]->m_sexiness = 50;
|
|
||||||
ms_apPedStats[i]->m_attackStrength = 1.0f;
|
|
||||||
ms_apPedStats[i]->m_defendWeakness = 1.0f;
|
|
||||||
ms_apPedStats[i]->m_flags = 0;
|
|
||||||
}
|
|
||||||
debug("Loading pedstats data...\n");
|
|
||||||
CPedStats::LoadPedStats();
|
|
||||||
debug("CPedStats ready\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
CPedStats::Shutdown(void)
|
|
||||||
{
|
|
||||||
int i;
|
|
||||||
debug("Shutting down CPedStats...\n");
|
|
||||||
for(i = 0; i < NUM_PEDSTATS; i++)
|
|
||||||
delete ms_apPedStats[i];
|
|
||||||
debug("CPedStats shut down\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
CPedStats::LoadPedStats(void)
|
|
||||||
{
|
|
||||||
char *buf;
|
|
||||||
char line[256];
|
|
||||||
char name[32];
|
|
||||||
size_t bp, buflen;
|
|
||||||
int lp, linelen;
|
|
||||||
int type;
|
|
||||||
float fleeDist, headingChangeRate, attackStrength, defendWeakness;
|
|
||||||
int fear, temper, lawfullness, sexiness, flags;
|
|
||||||
|
|
||||||
|
|
||||||
type = 0;
|
|
||||||
buf = new char[16 * 1024];
|
|
||||||
|
|
||||||
CFileMgr::SetDir("DATA");
|
|
||||||
buflen = CFileMgr::LoadFile("PEDSTATS.DAT", (uint8*)buf, 16 * 1024, "r");
|
|
||||||
CFileMgr::SetDir("");
|
|
||||||
|
|
||||||
for(bp = 0; bp < buflen; ){
|
|
||||||
// read file line by line
|
|
||||||
for(linelen = 0; buf[bp] != '\n' && bp < buflen; bp++){
|
|
||||||
if(buf[bp] == '\r' || buf[bp] == ',' || buf[bp] == '\t')
|
|
||||||
line[linelen++] = ' ';
|
|
||||||
else
|
|
||||||
line[linelen++] = buf[bp];
|
|
||||||
}
|
|
||||||
bp++;
|
|
||||||
line[linelen] = '\0';
|
|
||||||
|
|
||||||
// skip white space
|
|
||||||
for(lp = 0; line[lp] <= ' '; lp++);
|
|
||||||
|
|
||||||
if(lp >= linelen || // FIX: game uses == here, but this is safer if we have empty lines
|
|
||||||
line[lp] == '#')
|
|
||||||
continue;
|
|
||||||
|
|
||||||
sscanf(&line[lp], "%s %f %f %d %d %d %d %f %f %d",
|
|
||||||
name,
|
|
||||||
&fleeDist,
|
|
||||||
&headingChangeRate,
|
|
||||||
&fear,
|
|
||||||
&temper,
|
|
||||||
&lawfullness,
|
|
||||||
&sexiness,
|
|
||||||
&attackStrength,
|
|
||||||
&defendWeakness,
|
|
||||||
&flags);
|
|
||||||
ms_apPedStats[type]->m_type = (ePedStats)type;
|
|
||||||
strncpy(ms_apPedStats[type]->m_name, name, 24); // FIX: game uses strcpy
|
|
||||||
ms_apPedStats[type]->m_fleeDistance = fleeDist;
|
|
||||||
ms_apPedStats[type]->m_headingChangeRate = headingChangeRate;
|
|
||||||
ms_apPedStats[type]->m_fear = fear;
|
|
||||||
ms_apPedStats[type]->m_temper = temper;
|
|
||||||
ms_apPedStats[type]->m_lawfulness = lawfullness;
|
|
||||||
ms_apPedStats[type]->m_sexiness = sexiness;
|
|
||||||
ms_apPedStats[type]->m_attackStrength = attackStrength;
|
|
||||||
ms_apPedStats[type]->m_defendWeakness = defendWeakness;
|
|
||||||
ms_apPedStats[type]->m_flags = flags;
|
|
||||||
type++;
|
|
||||||
}
|
|
||||||
|
|
||||||
delete[] buf;
|
|
||||||
}
|
|
||||||
|
|
||||||
ePedStats
|
|
||||||
CPedStats::GetPedStatType(char *name)
|
|
||||||
{
|
|
||||||
for(uint16 type = 0; type < NUM_PEDSTATS; type++)
|
|
||||||
if(!CGeneral::faststrcmp(ms_apPedStats[type]->m_name, name))
|
|
||||||
return (ePedStats) type;
|
|
||||||
|
|
||||||
return NUM_PEDSTATS;
|
|
||||||
}
|
|
|
@ -1,85 +0,0 @@
|
||||||
#pragma once
|
|
||||||
|
|
||||||
enum ePedStats
|
|
||||||
{
|
|
||||||
PEDSTAT_PLAYER,
|
|
||||||
PEDSTAT_COP,
|
|
||||||
PEDSTAT_MEDIC,
|
|
||||||
PEDSTAT_FIREMAN,
|
|
||||||
PEDSTAT_GANG1,
|
|
||||||
PEDSTAT_GANG2,
|
|
||||||
PEDSTAT_GANG3,
|
|
||||||
PEDSTAT_GANG4,
|
|
||||||
PEDSTAT_GANG5,
|
|
||||||
PEDSTAT_GANG6,
|
|
||||||
PEDSTAT_GANG7,
|
|
||||||
PEDSTAT_STREET_GUY,
|
|
||||||
PEDSTAT_SUIT_GUY,
|
|
||||||
PEDSTAT_SENSIBLE_GUY,
|
|
||||||
PEDSTAT_GEEK_GUY,
|
|
||||||
PEDSTAT_OLD_GUY,
|
|
||||||
PEDSTAT_TOUGH_GUY,
|
|
||||||
PEDSTAT_STREET_GIRL,
|
|
||||||
PEDSTAT_SUIT_GIRL,
|
|
||||||
PEDSTAT_SENSIBLE_GIRL,
|
|
||||||
PEDSTAT_GEEK_GIRL,
|
|
||||||
PEDSTAT_OLD_GIRL,
|
|
||||||
PEDSTAT_TOUGH_GIRL,
|
|
||||||
PEDSTAT_TRAMP_MALE,
|
|
||||||
PEDSTAT_TRAMP_FEMALE,
|
|
||||||
PEDSTAT_TOURIST,
|
|
||||||
PEDSTAT_PROSTITUTE,
|
|
||||||
PEDSTAT_CRIMINAL,
|
|
||||||
PEDSTAT_BUSKER,
|
|
||||||
PEDSTAT_TAXIDRIVER,
|
|
||||||
PEDSTAT_PSYCHO,
|
|
||||||
PEDSTAT_STEWARD,
|
|
||||||
PEDSTAT_SPORTSFAN,
|
|
||||||
PEDSTAT_SHOPPER,
|
|
||||||
PEDSTAT_OLDSHOPPER,
|
|
||||||
PEDSTAT_BEACH_GUY,
|
|
||||||
PEDSTAT_BEACH_GIRL,
|
|
||||||
PEDSTAT_SKATER,
|
|
||||||
PEDSTAT_STD_MISSION,
|
|
||||||
PEDSTAT_COWARD,
|
|
||||||
|
|
||||||
NUM_PEDSTATS
|
|
||||||
};
|
|
||||||
|
|
||||||
// flags
|
|
||||||
enum
|
|
||||||
{
|
|
||||||
STAT_PUNCH_ONLY = 1,
|
|
||||||
STAT_CAN_KNEE_HEAD = 2,
|
|
||||||
STAT_CAN_KICK = 4,
|
|
||||||
STAT_CAN_ROUNDHOUSE = 8,
|
|
||||||
STAT_NO_DIVE = 0x10,
|
|
||||||
STAT_ONE_HIT_KNOCKDOWN = 0x20,
|
|
||||||
STAT_SHOPPING_BAGS = 0x40,
|
|
||||||
STAT_GUN_PANIC = 0x80
|
|
||||||
};
|
|
||||||
|
|
||||||
class CPedStats
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
ePedStats m_type;
|
|
||||||
char m_name[24];
|
|
||||||
float m_fleeDistance;
|
|
||||||
float m_headingChangeRate;
|
|
||||||
int8 m_fear;
|
|
||||||
int8 m_temper;
|
|
||||||
int8 m_lawfulness;
|
|
||||||
int8 m_sexiness;
|
|
||||||
float m_attackStrength;
|
|
||||||
float m_defendWeakness;
|
|
||||||
int16 m_flags;
|
|
||||||
|
|
||||||
static CPedStats *ms_apPedStats[NUM_PEDSTATS];
|
|
||||||
|
|
||||||
static void Initialise(void);
|
|
||||||
static void Shutdown(void);
|
|
||||||
static void LoadPedStats(void);
|
|
||||||
static ePedStats GetPedStatType(char *name);
|
|
||||||
};
|
|
||||||
|
|
||||||
VALIDATE_SIZE(CPedStats, 0x34);
|
|
|
@ -1,11 +1,13 @@
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
|
|
||||||
|
#include "General.h"
|
||||||
#include "FileMgr.h"
|
#include "FileMgr.h"
|
||||||
#include "PedType.h"
|
#include "PedType.h"
|
||||||
|
|
||||||
// --MIAMI: file done
|
// --MIAMI: file done
|
||||||
|
|
||||||
CPedType *CPedType::ms_apPedType[NUM_PEDTYPES];
|
CPedType *CPedType::ms_apPedType[NUM_PEDTYPES];
|
||||||
|
CPedStats *CPedStats::ms_apPedStats[NUM_PEDSTATS];
|
||||||
|
|
||||||
void
|
void
|
||||||
CPedType::Initialise(void)
|
CPedType::Initialise(void)
|
||||||
|
@ -204,3 +206,114 @@ INITSAVEBUF
|
||||||
*ms_apPedType[i] = ReadSaveBuf<CPedType>(buf);
|
*ms_apPedType[i] = ReadSaveBuf<CPedType>(buf);
|
||||||
VALIDATESAVEBUF(size)
|
VALIDATESAVEBUF(size)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
CPedStats::Initialise(void)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
|
debug("Initialising CPedStats...\n");
|
||||||
|
for(i = 0; i < NUM_PEDSTATS; i++){
|
||||||
|
ms_apPedStats[i] = new CPedStats;
|
||||||
|
ms_apPedStats[i]->m_type = PEDSTAT_PLAYER;
|
||||||
|
ms_apPedStats[i]->m_name[8] = 'R'; // WHAT?
|
||||||
|
ms_apPedStats[i]->m_fleeDistance = 20.0f;
|
||||||
|
ms_apPedStats[i]->m_headingChangeRate = 15.0f;
|
||||||
|
ms_apPedStats[i]->m_fear = 50;
|
||||||
|
ms_apPedStats[i]->m_temper = 50;
|
||||||
|
ms_apPedStats[i]->m_lawfulness = 50;
|
||||||
|
ms_apPedStats[i]->m_sexiness = 50;
|
||||||
|
ms_apPedStats[i]->m_attackStrength = 1.0f;
|
||||||
|
ms_apPedStats[i]->m_defendWeakness = 1.0f;
|
||||||
|
ms_apPedStats[i]->m_flags = 0;
|
||||||
|
}
|
||||||
|
debug("Loading pedstats data...\n");
|
||||||
|
CPedStats::LoadPedStats();
|
||||||
|
debug("CPedStats ready\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
CPedStats::Shutdown(void)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
debug("Shutting down CPedStats...\n");
|
||||||
|
for(i = 0; i < NUM_PEDSTATS; i++)
|
||||||
|
delete ms_apPedStats[i];
|
||||||
|
debug("CPedStats shut down\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
CPedStats::LoadPedStats(void)
|
||||||
|
{
|
||||||
|
char *buf;
|
||||||
|
char line[256];
|
||||||
|
char name[32];
|
||||||
|
size_t bp, buflen;
|
||||||
|
int lp, linelen;
|
||||||
|
int type;
|
||||||
|
float fleeDist, headingChangeRate, attackStrength, defendWeakness;
|
||||||
|
int fear, temper, lawfullness, sexiness, flags;
|
||||||
|
|
||||||
|
|
||||||
|
type = 0;
|
||||||
|
buf = new char[16 * 1024];
|
||||||
|
|
||||||
|
CFileMgr::SetDir("DATA");
|
||||||
|
buflen = CFileMgr::LoadFile("PEDSTATS.DAT", (uint8*)buf, 16 * 1024, "r");
|
||||||
|
CFileMgr::SetDir("");
|
||||||
|
|
||||||
|
for(bp = 0; bp < buflen; ){
|
||||||
|
// read file line by line
|
||||||
|
for(linelen = 0; buf[bp] != '\n' && bp < buflen; bp++){
|
||||||
|
if(buf[bp] == '\r' || buf[bp] == ',' || buf[bp] == '\t')
|
||||||
|
line[linelen++] = ' ';
|
||||||
|
else
|
||||||
|
line[linelen++] = buf[bp];
|
||||||
|
}
|
||||||
|
bp++;
|
||||||
|
line[linelen] = '\0';
|
||||||
|
|
||||||
|
// skip white space
|
||||||
|
for(lp = 0; line[lp] <= ' '; lp++);
|
||||||
|
|
||||||
|
if(lp >= linelen || // FIX: game uses == here, but this is safer if we have empty lines
|
||||||
|
line[lp] == '#')
|
||||||
|
continue;
|
||||||
|
|
||||||
|
sscanf(&line[lp], "%s %f %f %d %d %d %d %f %f %d",
|
||||||
|
name,
|
||||||
|
&fleeDist,
|
||||||
|
&headingChangeRate,
|
||||||
|
&fear,
|
||||||
|
&temper,
|
||||||
|
&lawfullness,
|
||||||
|
&sexiness,
|
||||||
|
&attackStrength,
|
||||||
|
&defendWeakness,
|
||||||
|
&flags);
|
||||||
|
ms_apPedStats[type]->m_type = (ePedStats)type;
|
||||||
|
strncpy(ms_apPedStats[type]->m_name, name, 24); // FIX: game uses strcpy
|
||||||
|
ms_apPedStats[type]->m_fleeDistance = fleeDist;
|
||||||
|
ms_apPedStats[type]->m_headingChangeRate = headingChangeRate;
|
||||||
|
ms_apPedStats[type]->m_fear = fear;
|
||||||
|
ms_apPedStats[type]->m_temper = temper;
|
||||||
|
ms_apPedStats[type]->m_lawfulness = lawfullness;
|
||||||
|
ms_apPedStats[type]->m_sexiness = sexiness;
|
||||||
|
ms_apPedStats[type]->m_attackStrength = attackStrength;
|
||||||
|
ms_apPedStats[type]->m_defendWeakness = defendWeakness;
|
||||||
|
ms_apPedStats[type]->m_flags = flags;
|
||||||
|
type++;
|
||||||
|
}
|
||||||
|
|
||||||
|
delete[] buf;
|
||||||
|
}
|
||||||
|
|
||||||
|
ePedStats
|
||||||
|
CPedStats::GetPedStatType(char *name)
|
||||||
|
{
|
||||||
|
for(uint16 type = 0; type < NUM_PEDSTATS; type++)
|
||||||
|
if(!CGeneral::faststrcmp(ms_apPedStats[type]->m_name, name))
|
||||||
|
return (ePedStats) type;
|
||||||
|
|
||||||
|
return NUM_PEDSTATS;
|
||||||
|
}
|
||||||
|
|
|
@ -92,3 +92,87 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
VALIDATE_SIZE(CPedType, 0x20);
|
VALIDATE_SIZE(CPedType, 0x20);
|
||||||
|
|
||||||
|
enum ePedStats
|
||||||
|
{
|
||||||
|
PEDSTAT_PLAYER,
|
||||||
|
PEDSTAT_COP,
|
||||||
|
PEDSTAT_MEDIC,
|
||||||
|
PEDSTAT_FIREMAN,
|
||||||
|
PEDSTAT_GANG1,
|
||||||
|
PEDSTAT_GANG2,
|
||||||
|
PEDSTAT_GANG3,
|
||||||
|
PEDSTAT_GANG4,
|
||||||
|
PEDSTAT_GANG5,
|
||||||
|
PEDSTAT_GANG6,
|
||||||
|
PEDSTAT_GANG7,
|
||||||
|
PEDSTAT_STREET_GUY,
|
||||||
|
PEDSTAT_SUIT_GUY,
|
||||||
|
PEDSTAT_SENSIBLE_GUY,
|
||||||
|
PEDSTAT_GEEK_GUY,
|
||||||
|
PEDSTAT_OLD_GUY,
|
||||||
|
PEDSTAT_TOUGH_GUY,
|
||||||
|
PEDSTAT_STREET_GIRL,
|
||||||
|
PEDSTAT_SUIT_GIRL,
|
||||||
|
PEDSTAT_SENSIBLE_GIRL,
|
||||||
|
PEDSTAT_GEEK_GIRL,
|
||||||
|
PEDSTAT_OLD_GIRL,
|
||||||
|
PEDSTAT_TOUGH_GIRL,
|
||||||
|
PEDSTAT_TRAMP_MALE,
|
||||||
|
PEDSTAT_TRAMP_FEMALE,
|
||||||
|
PEDSTAT_TOURIST,
|
||||||
|
PEDSTAT_PROSTITUTE,
|
||||||
|
PEDSTAT_CRIMINAL,
|
||||||
|
PEDSTAT_BUSKER,
|
||||||
|
PEDSTAT_TAXIDRIVER,
|
||||||
|
PEDSTAT_PSYCHO,
|
||||||
|
PEDSTAT_STEWARD,
|
||||||
|
PEDSTAT_SPORTSFAN,
|
||||||
|
PEDSTAT_SHOPPER,
|
||||||
|
PEDSTAT_OLDSHOPPER,
|
||||||
|
PEDSTAT_BEACH_GUY,
|
||||||
|
PEDSTAT_BEACH_GIRL,
|
||||||
|
PEDSTAT_SKATER,
|
||||||
|
PEDSTAT_STD_MISSION,
|
||||||
|
PEDSTAT_COWARD,
|
||||||
|
|
||||||
|
NUM_PEDSTATS
|
||||||
|
};
|
||||||
|
|
||||||
|
// flags
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
STAT_PUNCH_ONLY = 1,
|
||||||
|
STAT_CAN_KNEE_HEAD = 2,
|
||||||
|
STAT_CAN_KICK = 4,
|
||||||
|
STAT_CAN_ROUNDHOUSE = 8,
|
||||||
|
STAT_NO_DIVE = 0x10,
|
||||||
|
STAT_ONE_HIT_KNOCKDOWN = 0x20,
|
||||||
|
STAT_SHOPPING_BAGS = 0x40,
|
||||||
|
STAT_GUN_PANIC = 0x80
|
||||||
|
};
|
||||||
|
|
||||||
|
class CPedStats
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
ePedStats m_type;
|
||||||
|
char m_name[24];
|
||||||
|
float m_fleeDistance;
|
||||||
|
float m_headingChangeRate;
|
||||||
|
int8 m_fear;
|
||||||
|
int8 m_temper;
|
||||||
|
int8 m_lawfulness;
|
||||||
|
int8 m_sexiness;
|
||||||
|
float m_attackStrength;
|
||||||
|
float m_defendWeakness;
|
||||||
|
int16 m_flags;
|
||||||
|
|
||||||
|
static CPedStats *ms_apPedStats[NUM_PEDSTATS];
|
||||||
|
|
||||||
|
static void Initialise(void);
|
||||||
|
static void Shutdown(void);
|
||||||
|
static void LoadPedStats(void);
|
||||||
|
static ePedStats GetPedStatType(char *name);
|
||||||
|
};
|
||||||
|
|
||||||
|
VALIDATE_SIZE(CPedStats, 0x34);
|
||||||
|
|
|
@ -1492,6 +1492,45 @@ CRenderer::RequestObjectsInFrustum(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// --MIAMI: Done
|
||||||
|
bool
|
||||||
|
CPed::SetupLighting(void)
|
||||||
|
{
|
||||||
|
ActivateDirectional();
|
||||||
|
SetAmbientColoursForPedsCarsAndObjects();
|
||||||
|
|
||||||
|
#ifndef MASTER
|
||||||
|
// Originally this was being called through iteration of Sectors, but putting it here is better.
|
||||||
|
if (GetDebugDisplay() != 0 && !IsPlayer())
|
||||||
|
DebugRenderOnePedText();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if (bRenderScorched) {
|
||||||
|
WorldReplaceNormalLightsWithScorched(Scene.world, 0.1f);
|
||||||
|
} else {
|
||||||
|
// Note that this lightMult is only affected by LIGHT_DARKEN. If there's no LIGHT_DARKEN, it will be 1.0.
|
||||||
|
float lightMult = CPointLights::GenerateLightsAffectingObject(&GetPosition());
|
||||||
|
if (lightMult != 1.0f) {
|
||||||
|
SetAmbientAndDirectionalColours(lightMult);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// --MIAMI: Done
|
||||||
|
void
|
||||||
|
CPed::RemoveLighting(bool reset)
|
||||||
|
{
|
||||||
|
if (!bRenderScorched) {
|
||||||
|
CRenderer::RemoveVehiclePedLights(this, reset);
|
||||||
|
if (reset)
|
||||||
|
ReSetAmbientAndDirectionalColours();
|
||||||
|
}
|
||||||
|
SetAmbientColours();
|
||||||
|
DeActivateDirectional();
|
||||||
|
}
|
||||||
|
|
||||||
float
|
float
|
||||||
CalcNewDelta(RwV2d *a, RwV2d *b)
|
CalcNewDelta(RwV2d *a, RwV2d *b)
|
||||||
{
|
{
|
||||||
|
|
|
@ -48,6 +48,7 @@
|
||||||
#include "PlayerPed.h"
|
#include "PlayerPed.h"
|
||||||
#include "Object.h"
|
#include "Object.h"
|
||||||
#include "Automobile.h"
|
#include "Automobile.h"
|
||||||
|
#include "Bike.h"
|
||||||
|
|
||||||
//--MIAMI: file done
|
//--MIAMI: file done
|
||||||
|
|
||||||
|
@ -5109,6 +5110,142 @@ CAutomobile::HasCarStoppedBecauseOfLight(void)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// --MIAMI: Done
|
||||||
|
void
|
||||||
|
CPed::DeadPedMakesTyresBloody(void)
|
||||||
|
{
|
||||||
|
int minX = CWorld::GetSectorIndexX(GetPosition().x - 2.0f);
|
||||||
|
if (minX < 0) minX = 0;
|
||||||
|
int minY = CWorld::GetSectorIndexY(GetPosition().y - 2.0f);
|
||||||
|
if (minY < 0) minY = 0;
|
||||||
|
int maxX = CWorld::GetSectorIndexX(GetPosition().x + 2.0f);
|
||||||
|
if (maxX > NUMSECTORS_X-1) maxX = NUMSECTORS_X-1;
|
||||||
|
int maxY = CWorld::GetSectorIndexY(GetPosition().y + 2.0f);
|
||||||
|
if (maxY > NUMSECTORS_Y-1) maxY = NUMSECTORS_Y-1;
|
||||||
|
|
||||||
|
CWorld::AdvanceCurrentScanCode();
|
||||||
|
|
||||||
|
for (int curY = minY; curY <= maxY; curY++) {
|
||||||
|
for (int curX = minX; curX <= maxX; curX++) {
|
||||||
|
CSector *sector = CWorld::GetSector(curX, curY);
|
||||||
|
MakeTyresMuddySectorList(sector->m_lists[ENTITYLIST_VEHICLES]);
|
||||||
|
MakeTyresMuddySectorList(sector->m_lists[ENTITYLIST_VEHICLES_OVERLAP]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// --MIAMI: Done
|
||||||
|
void
|
||||||
|
CPed::MakeTyresMuddySectorList(CPtrList &list)
|
||||||
|
{
|
||||||
|
CAutomobile *car = nil;
|
||||||
|
CBike *bike = nil;
|
||||||
|
for (CPtrNode *node = list.first; node; node = node->next) {
|
||||||
|
CVehicle *veh = (CVehicle*)node->item;
|
||||||
|
if (veh->m_scanCode != CWorld::GetCurrentScanCode()) {
|
||||||
|
veh->m_scanCode = CWorld::GetCurrentScanCode();
|
||||||
|
|
||||||
|
if (Abs(GetPosition().x - veh->GetPosition().x) < 10.0f && Abs(GetPosition().y - veh->GetPosition().y) < 10.0f) {
|
||||||
|
if (veh->IsCar()) {
|
||||||
|
bike = nil;
|
||||||
|
car = (CAutomobile*)veh;
|
||||||
|
} else if (veh->IsBike()) {
|
||||||
|
bike = (CBike*)veh;
|
||||||
|
car = nil;
|
||||||
|
}
|
||||||
|
if (veh->m_vecMoveSpeed.MagnitudeSqr2D() > 0.05f) {
|
||||||
|
if (car) {
|
||||||
|
for (int wheel = 0; wheel < 4; wheel++) {
|
||||||
|
if (!car->m_aWheelSkidmarkBloody[wheel] && car->m_aSuspensionSpringRatio[wheel] < 1.0f) {
|
||||||
|
|
||||||
|
CColModel* vehCol = car->GetModelInfo()->GetColModel();
|
||||||
|
CVector approxWheelOffset;
|
||||||
|
switch (wheel) {
|
||||||
|
case 0:
|
||||||
|
approxWheelOffset = CVector(-vehCol->boundingBox.max.x, vehCol->boundingBox.max.y, 0.0f);
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
approxWheelOffset = CVector(-vehCol->boundingBox.max.x, vehCol->boundingBox.min.y, 0.0f);
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
approxWheelOffset = CVector(vehCol->boundingBox.max.x, vehCol->boundingBox.max.y, 0.0f);
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
approxWheelOffset = CVector(vehCol->boundingBox.max.x, vehCol->boundingBox.min.y, 0.0f);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
// I hope so
|
||||||
|
CVector wheelPos = car->GetMatrix() * approxWheelOffset;
|
||||||
|
if (Abs(wheelPos.z - GetPosition().z) < 2.0f) {
|
||||||
|
|
||||||
|
if ((wheelPos - GetPosition()).MagnitudeSqr2D() < 1.0f) {
|
||||||
|
if (CGame::nastyGame) {
|
||||||
|
car->m_aWheelSkidmarkBloody[wheel] = true;
|
||||||
|
DMAudio.PlayOneShot(car->m_audioEntityId, SOUND_SPLATTER, 0.0f);
|
||||||
|
}
|
||||||
|
if (car->m_fMass > 500.f) {
|
||||||
|
car->ApplyMoveForce(CVector(0.0f, 0.0f, 50.0f * Min(1.0f, m_fMass * 0.001f)));
|
||||||
|
|
||||||
|
CVector vehAndWheelDist = wheelPos - car->GetPosition();
|
||||||
|
car->ApplyTurnForce(CVector(0.0f, 0.0f, 50.0f * Min(1.0f, m_fTurnMass * 0.0005f)), vehAndWheelDist);
|
||||||
|
if (car == FindPlayerVehicle()) {
|
||||||
|
CPad::GetPad(0)->StartShake(300, 70);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (bike) {
|
||||||
|
for (int wheel = 0; wheel < 2; wheel++) {
|
||||||
|
if (!bike->m_aWheelSkidmarkBloody[wheel] && bike->m_aSuspensionSpringRatio[wheel] < 1.0f) {
|
||||||
|
|
||||||
|
CColModel* vehCol = bike->GetModelInfo()->GetColModel();
|
||||||
|
CVector approxWheelOffset;
|
||||||
|
switch (wheel) {
|
||||||
|
case 0:
|
||||||
|
approxWheelOffset = CVector(0.0f, 0.8f * vehCol->boundingBox.max.y, 0.0f);
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
approxWheelOffset = CVector(0.0f, 0.8f * vehCol->boundingBox.min.y, 0.0f);
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
// I hope so
|
||||||
|
CVector wheelPos = bike->GetMatrix() * approxWheelOffset;
|
||||||
|
if (Abs(wheelPos.z - GetPosition().z) < 2.0f) {
|
||||||
|
|
||||||
|
if ((wheelPos - GetPosition()).MagnitudeSqr2D() < 1.0f) {
|
||||||
|
if (CGame::nastyGame) {
|
||||||
|
bike->m_aWheelSkidmarkBloody[wheel] = true;
|
||||||
|
DMAudio.PlayOneShot(bike->m_audioEntityId, SOUND_SPLATTER, 0.0f);
|
||||||
|
}
|
||||||
|
if (bike->m_fMass > 100.0f) {
|
||||||
|
bike->ApplyMoveForce(CVector(0.0f, 0.0f, 10.0f));
|
||||||
|
|
||||||
|
CVector vehAndWheelDist = wheelPos - bike->GetPosition();
|
||||||
|
bike->ApplyTurnForce(CVector(0.0f, 0.0f, 10.0f), vehAndWheelDist);
|
||||||
|
|
||||||
|
if (bike == FindPlayerVehicle()) {
|
||||||
|
CPad::GetPad(0)->StartShake(300, 70);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
CAutomobile::SetBusDoorTimer(uint32 timer, uint8 type)
|
CAutomobile::SetBusDoorTimer(uint32 timer, uint8 type)
|
||||||
{
|
{
|
||||||
|
|
|
@ -3171,6 +3171,21 @@ CWeapon::HasWeaponAmmoToBeUsed(void)
|
||||||
return m_nAmmoTotal != 0;
|
return m_nAmmoTotal != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// --MIAMI: Done
|
||||||
|
bool
|
||||||
|
CPed::IsPedDoingDriveByShooting(void)
|
||||||
|
{
|
||||||
|
#ifdef FIX_BUGS
|
||||||
|
if (FindPlayerPed() == this && CWeaponInfo::GetWeaponInfo(GetWeapon()->m_eWeaponType)->m_nWeaponSlot == 5) {
|
||||||
|
#else
|
||||||
|
if (FindPlayerPed() == this && GetWeapon()->m_eWeaponType == WEAPONTYPE_UZI) {
|
||||||
|
#endif
|
||||||
|
if (TheCamera.Cams[TheCamera.ActiveCam].LookingLeft || TheCamera.Cams[TheCamera.ActiveCam].LookingRight)
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
CWeapon::ProcessLineOfSight(CVector const &point1, CVector const &point2, CColPoint &point, CEntity *&entity, eWeaponType type, CEntity *shooter, bool checkBuildings, bool checkVehicles, bool checkPeds, bool checkObjects, bool checkDummies, bool ignoreSeeThrough, bool ignoreSomeObjects)
|
CWeapon::ProcessLineOfSight(CVector const &point1, CVector const &point2, CColPoint &point, CEntity *&entity, eWeaponType type, CEntity *shooter, bool checkBuildings, bool checkVehicles, bool checkPeds, bool checkObjects, bool checkDummies, bool ignoreSeeThrough, bool ignoreSomeObjects)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue