1
0
Fork 0
mirror of https://git.rip/DMCA_FUCKER/re3.git synced 2024-12-23 17:10:01 +00:00

Merge pull request #586 from aap/miami

CVehicle
This commit is contained in:
aap 2020-05-26 11:25:23 +02:00 committed by GitHub
commit 0b8f045d36
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
33 changed files with 1448 additions and 438 deletions

View file

@ -913,7 +913,7 @@ CCarCtrl::RemoveDistantCars()
PossiblyRemoveVehicle(pVehicle);
if (pVehicle->bCreateRoadBlockPeds){
if ((pVehicle->GetPosition() - FindPlayerCentreOfWorld(CWorld::PlayerInFocus)).Magnitude2D() < DISTANCE_TO_SPAWN_ROADBLOCK_PEDS) {
CRoadBlocks::GenerateRoadBlockCopsForCar(pVehicle, pVehicle->m_nRoadblockType, pVehicle->m_nRoadblockNode);
CRoadBlocks::GenerateRoadBlockCopsForCar(pVehicle, pVehicle->m_nRoadblockType);
pVehicle->bCreateRoadBlockPeds = false;
}
}

View file

@ -47,7 +47,7 @@ CRoadBlocks::Init(void)
}
void
CRoadBlocks::GenerateRoadBlockCopsForCar(CVehicle* pVehicle, int32 roadBlockType, int16 roadBlockNode)
CRoadBlocks::GenerateRoadBlockCopsForCar(CVehicle* pVehicle, int32 roadBlockType)
{
static const CVector vecRoadBlockOffets[6] = { {-1.5, 1.8f, 0.0f}, {-1.5f, -1.8f, 0.0f}, {1.5f, 1.8f, 0.0f},
{1.5f, -1.8f, 0.0f}, {-1.5f, 0.0f, 0.0f}, {1.5, 0.0, 0.0} };
@ -90,7 +90,7 @@ CRoadBlocks::GenerateRoadBlockCopsForCar(CVehicle* pVehicle, int32 roadBlockType
pCopPed->SetIdle();
pCopPed->bKindaStayInSamePlace = true;
pCopPed->bNotAllowedToDuck = false;
pCopPed->m_nRoadblockNode = roadBlockNode;
// pCopPed->m_nRoadblockNode = roadBlockNode;
pCopPed->bCrouchWhenShooting = roadBlockType != 2;
if (pEntityToAttack) {
pCopPed->m_pPointGunAt = pEntityToAttack;

View file

@ -15,6 +15,6 @@ public:
static bool InOrOut[NUMROADBLOCKS];
static void Init(void);
static void GenerateRoadBlockCopsForCar(CVehicle* pVehicle, int32 roadBlockType, int16 roadBlockNode);
static void GenerateRoadBlockCopsForCar(CVehicle* pVehicle, int32 roadBlockType);
static void GenerateRoadBlocks(void);
};

View file

@ -10943,10 +10943,10 @@ int8 CRunningScript::ProcessCommands1200To1299(int32 command)
ScriptParams[1] = 0;
else if (ScriptParams[1] == 3)
ScriptParams[1] = 1;
pVehicle->BurstTyre(ScriptParams[1]); // TODO(MIAMI): second param is true
pVehicle->BurstTyre(ScriptParams[1], true);
}
else {
pVehicle->BurstTyre(ScriptParams[1]); // TODO(MIAMI): second param is true
pVehicle->BurstTyre(ScriptParams[1], true);
}
return 0;
}

View file

@ -108,6 +108,7 @@ CTrafficLights::DisplayActualLight(CEntity *ent)
CBrightLights::RegisterOne(pos1, ent->GetUp(), ent->GetRight(), CVector(0.0f, 0.0f, 0.0f), id + BRIGHTLIGHT_TRAFFIC_GREEN);
CBrightLights::RegisterOne(pos2, ent->GetUp(), -ent->GetRight(), CVector(0.0f, 0.0f, 0.0f), id + BRIGHTLIGHT_TRAFFIC_GREEN);
/*
static const float top = -0.127f;
static const float bot = -0.539f;
static const float mid = bot + (top-bot)/3.0f;
@ -131,6 +132,7 @@ CTrafficLights::DisplayActualLight(CEntity *ent)
1.0f, 0.5f, 0.0f, 0.5f, 1.0f, 1.0f, 0.0f, 1.0f,
SHINYTEXT_WALK, 255, 255, 255, 60.0f);
}
*/
}
void

View file

@ -3281,6 +3281,18 @@ CCamera::Find3rdPersonQuickAimPitch(void)
return -(DEGTORAD(((0.5f - m_f3rdPersonCHairMultY) * 1.8f * 0.5f * Cams[ActiveCam].FOV)) + rot);
}
bool
CCamera::Using1stPersonWeaponMode(void)
{
switch(PlayerWeaponMode.Mode)
case CCam::MODE_SNIPER:
case CCam::MODE_M16_1STPERSON:
case CCam::MODE_ROCKETLAUNCHER:
case CCam::MODE_HELICANNON_1STPERSON:
case CCam::MODE_CAMERA:
return true;
return false;
}
void

View file

@ -91,7 +91,9 @@ public:
MODE_M16_1STPERSON_RUNABOUT,
MODE_FIGHT_CAM_RUNABOUT,
MODE_EDITOR,
MODE_HELICANNON_1STPERSON, // vice city leftover
MODE_HELICANNON_1STPERSON,
MODE_45,
MODE_CAMERA,
};
bool bBelowMinDist; //used for follow ped mode
@ -625,6 +627,7 @@ public:
void UpdateAimingCoors(CVector const &coors);
void Find3rdPersonCamTargetVector(float dist, CVector pos, CVector &source, CVector &target);
float Find3rdPersonQuickAimPitch(void);
bool Using1stPersonWeaponMode(void);
// Physical camera
void SetRwCamera(RwCamera *cam);

View file

@ -414,8 +414,9 @@ CCollision::TestSphereTriangle(const CColSphere &sphere,
return dist < sphere.radius;
}
//--MIAMI: TODO
bool
CCollision::TestLineOfSight(const CColLine &line, const CMatrix &matrix, CColModel &model, bool ignoreSeeThrough)
CCollision::TestLineOfSight(const CColLine &line, const CMatrix &matrix, CColModel &model, bool ignoreSeeThrough, bool ignoreShootThrough)
{
static CMatrix matTransform;
int i;
@ -1042,10 +1043,11 @@ CCollision::ProcessSphereTriangle(const CColSphere &sphere,
return true;
}
//--MIAMI: TODO
bool
CCollision::ProcessLineOfSight(const CColLine &line,
const CMatrix &matrix, CColModel &model,
CColPoint &point, float &mindist, bool ignoreSeeThrough)
CColPoint &point, float &mindist, bool ignoreSeeThrough, bool ignoreShootThrough)
{
static CMatrix matTransform;
int i;
@ -1081,10 +1083,11 @@ CCollision::ProcessLineOfSight(const CColLine &line,
return false;
}
//--MIAMI: TODO
bool
CCollision::ProcessVerticalLine(const CColLine &line,
const CMatrix &matrix, CColModel &model,
CColPoint &point, float &mindist, bool ignoreSeeThrough, CStoredCollPoly *poly)
CColPoint &point, float &mindist, bool ignoreSeeThrough, bool ignoreShootThrough, CStoredCollPoly *poly)
{
static CStoredCollPoly TempStoredPoly;
int i;

View file

@ -151,7 +151,7 @@ public:
static bool TestLineTriangle(const CColLine &line, const CVector *verts, const CColTriangle &tri, const CColTrianglePlane &plane);
static bool TestLineSphere(const CColLine &line, const CColSphere &sph);
static bool TestSphereTriangle(const CColSphere &sphere, const CVector *verts, const CColTriangle &tri, const CColTrianglePlane &plane);
static bool TestLineOfSight(const CColLine &line, const CMatrix &matrix, CColModel &model, bool ignoreSeeThrough);
static bool TestLineOfSight(const CColLine &line, const CMatrix &matrix, CColModel &model, bool ignoreSeeThrough, bool ignoreShootThrough);
static bool ProcessSphereSphere(const CColSphere &s1, const CColSphere &s2, CColPoint &point, float &mindistsq);
static bool ProcessSphereBox(const CColSphere &sph, const CColBox &box, CColPoint &point, float &mindistsq);
@ -160,8 +160,8 @@ public:
static bool ProcessLineTriangle(const CColLine &line , const CVector *verts, const CColTriangle &tri, const CColTrianglePlane &plane, CColPoint &point, float &mindist);
static bool ProcessLineSphere(const CColLine &line, const CColSphere &sphere, CColPoint &point, float &mindist);
static bool ProcessSphereTriangle(const CColSphere &sph, const CVector *verts, const CColTriangle &tri, const CColTrianglePlane &plane, CColPoint &point, float &mindistsq);
static bool ProcessLineOfSight(const CColLine &line, const CMatrix &matrix, CColModel &model, CColPoint &point, float &mindist, bool ignoreSeeThrough);
static bool ProcessVerticalLine(const CColLine &line, const CMatrix &matrix, CColModel &model, CColPoint &point, float &mindist, bool ignoreSeeThrough, CStoredCollPoly *poly);
static bool ProcessLineOfSight(const CColLine &line, const CMatrix &matrix, CColModel &model, CColPoint &point, float &mindist, bool ignoreSeeThrough, bool ignoreShootThrough);
static bool ProcessVerticalLine(const CColLine &line, const CMatrix &matrix, CColModel &model, CColPoint &point, float &mindist, bool ignoreSeeThrough, bool ignoreShootThrough, CStoredCollPoly *poly);
static int32 ProcessColModels(const CMatrix &matrixA, CColModel &modelA, const CMatrix &matrixB, CColModel &modelB, CColPoint *spherepoints, CColPoint *linepoints, float *linedists);
static bool IsStoredPolyStillValidVerticalLine(const CVector &pos, float z, CColPoint &point, CStoredCollPoly *poly);

View file

@ -51,6 +51,7 @@ public:
int32 field_268;
int32 field_272;
uint32 m_nHavocLevel;
float m_fMediaAttention;
bool m_bInfiniteSprint;
bool m_bFastReload;
bool m_bFireproof;

View file

@ -33,22 +33,24 @@
CColPoint gaTempSphereColPoints[MAX_COLLISION_POINTS];
CPtrList CWorld::ms_bigBuildingsList[4];// = (CPtrList*)0x6FAB60;
CPtrList CWorld::ms_listMovingEntityPtrs;// = *(CPtrList*)0x8F433C;
CSector CWorld::ms_aSectors[NUMSECTORS_Y][NUMSECTORS_X];// = (CSector (*)[NUMSECTORS_Y])0x665608;
uint16 CWorld::ms_nCurrentScanCode;// = *(uint16*)0x95CC64;
CPtrList CWorld::ms_bigBuildingsList[4];
CPtrList CWorld::ms_listMovingEntityPtrs;
CSector CWorld::ms_aSectors[NUMSECTORS_Y][NUMSECTORS_X];
uint16 CWorld::ms_nCurrentScanCode;
uint8 CWorld::PlayerInFocus;// = *(uint8 *)0x95CD61;
uint8 CWorld::PlayerInFocus;
CPlayerInfo CWorld::Players[NUMPLAYERS];
bool CWorld::bNoMoreCollisionTorque;// = *(bool*)0x95CDCC;
CEntity *CWorld::pIgnoreEntity;// = *(CEntity**)0x8F6494;
bool CWorld::bIncludeDeadPeds;// = *(bool*)0x95CD8F;
bool CWorld::bSecondShift;// = *(bool*)0x95CD54;
bool CWorld::bForceProcessControl;// = *(bool*)0x95CD6C;
bool CWorld::bProcessCutsceneOnly;// = *(bool*)0x95CD8B;
bool CWorld::bNoMoreCollisionTorque;
CEntity *CWorld::pIgnoreEntity;
bool CWorld::bIncludeDeadPeds;
bool CWorld::bSecondShift;
bool CWorld::bForceProcessControl;
bool CWorld::bProcessCutsceneOnly;
bool CWorld::bDoingCarCollisions;// = *(bool*)0x95CD8C;
bool CWorld::bIncludeCarTyres;// = *(bool*)0x95CDAA;
bool CWorld::bDoingCarCollisions;
bool CWorld::bIncludeCarTyres;
CColPoint CWorld::m_aTempColPts[MAX_COLLISION_POINTS];
void
CWorld::Initialise()
@ -165,7 +167,7 @@ CWorld::CameraToIgnoreThisObject(CEntity *ent)
bool
CWorld::ProcessLineOfSight(const CVector &point1, const CVector &point2, CColPoint &point, CEntity *&entity,
bool checkBuildings, bool checkVehicles, bool checkPeds, bool checkObjects,
bool checkDummies, bool ignoreSeeThrough, bool ignoreSomeObjects)
bool checkDummies, bool ignoreSeeThrough, bool ignoreSomeObjects, bool ignoreShootThrough)
{
int x, xstart, xend;
int y, ystart, yend;
@ -184,7 +186,7 @@ CWorld::ProcessLineOfSight(const CVector &point1, const CVector &point2, CColPoi
#define LOSARGS \
CColLine(point1, point2), point, dist, entity, checkBuildings, checkVehicles, checkPeds, checkObjects, \
checkDummies, ignoreSeeThrough, ignoreSomeObjects
checkDummies, ignoreSeeThrough, ignoreSomeObjects, ignoreShootThrough
if(xstart == xend && ystart == yend) {
// Only one sector
@ -266,7 +268,7 @@ CWorld::ProcessLineOfSight(const CVector &point1, const CVector &point2, CColPoi
bool
CWorld::ProcessLineOfSightSector(CSector &sector, const CColLine &line, CColPoint &point, float &dist, CEntity *&entity,
bool checkBuildings, bool checkVehicles, bool checkPeds, bool checkObjects,
bool checkDummies, bool ignoreSeeThrough, bool ignoreSomeObjects)
bool checkDummies, bool ignoreSeeThrough, bool ignoreSomeObjects, bool ignoreShootThrough)
{
float mindist = dist;
bool deadPeds = !!bIncludeDeadPeds;
@ -274,39 +276,39 @@ CWorld::ProcessLineOfSightSector(CSector &sector, const CColLine &line, CColPoin
if(checkBuildings) {
ProcessLineOfSightSectorList(sector.m_lists[ENTITYLIST_BUILDINGS], line, point, mindist, entity,
ignoreSeeThrough);
ignoreSeeThrough, false, ignoreShootThrough);
ProcessLineOfSightSectorList(sector.m_lists[ENTITYLIST_BUILDINGS_OVERLAP], line, point, mindist, entity,
ignoreSeeThrough);
ignoreSeeThrough, false, ignoreShootThrough);
}
if(checkVehicles) {
ProcessLineOfSightSectorList(sector.m_lists[ENTITYLIST_VEHICLES], line, point, mindist, entity,
ignoreSeeThrough);
ignoreSeeThrough, false, ignoreShootThrough);
ProcessLineOfSightSectorList(sector.m_lists[ENTITYLIST_VEHICLES_OVERLAP], line, point, mindist, entity,
ignoreSeeThrough);
ignoreSeeThrough, false, ignoreShootThrough);
}
if(checkPeds) {
if(deadPeds) bIncludeDeadPeds = true;
ProcessLineOfSightSectorList(sector.m_lists[ENTITYLIST_PEDS], line, point, mindist, entity,
ignoreSeeThrough);
ignoreSeeThrough, false, ignoreShootThrough);
ProcessLineOfSightSectorList(sector.m_lists[ENTITYLIST_PEDS_OVERLAP], line, point, mindist, entity,
ignoreSeeThrough);
ignoreSeeThrough, false, ignoreShootThrough);
bIncludeDeadPeds = false;
}
if(checkObjects) {
ProcessLineOfSightSectorList(sector.m_lists[ENTITYLIST_OBJECTS], line, point, mindist, entity,
ignoreSeeThrough, ignoreSomeObjects);
ignoreSeeThrough, ignoreSomeObjects, ignoreShootThrough);
ProcessLineOfSightSectorList(sector.m_lists[ENTITYLIST_OBJECTS_OVERLAP], line, point, mindist, entity,
ignoreSeeThrough, ignoreSomeObjects);
ignoreSeeThrough, ignoreSomeObjects, ignoreShootThrough);
}
if(checkDummies) {
ProcessLineOfSightSectorList(sector.m_lists[ENTITYLIST_DUMMIES], line, point, mindist, entity,
ignoreSeeThrough);
ignoreSeeThrough, false, ignoreShootThrough);
ProcessLineOfSightSectorList(sector.m_lists[ENTITYLIST_DUMMIES_OVERLAP], line, point, mindist, entity,
ignoreSeeThrough);
ignoreSeeThrough, false, ignoreShootThrough);
}
bIncludeDeadPeds = deadPeds;
@ -320,7 +322,7 @@ CWorld::ProcessLineOfSightSector(CSector &sector, const CColLine &line, CColPoin
bool
CWorld::ProcessLineOfSightSectorList(CPtrList &list, const CColLine &line, CColPoint &point, float &dist,
CEntity *&entity, bool ignoreSeeThrough, bool ignoreSomeObjects)
CEntity *&entity, bool ignoreSeeThrough, bool ignoreSomeObjects, bool ignoreShootThrough)
{
bool deadPeds = false;
float mindist = dist;
@ -347,7 +349,7 @@ CWorld::ProcessLineOfSightSectorList(CPtrList &list, const CColLine &line, CColP
colmodel = CModelInfo::GetModelInfo(e->GetModelIndex())->GetColModel();
if(colmodel && CCollision::ProcessLineOfSight(line, e->GetMatrix(), *colmodel, point, dist,
ignoreSeeThrough))
ignoreSeeThrough, ignoreShootThrough))
entity = e;
}
}
@ -436,7 +438,7 @@ CWorld::ProcessVerticalLineSectorList(CPtrList &list, const CColLine &line, CCol
colmodel = CModelInfo::GetModelInfo(e->GetModelIndex())->GetColModel();
if(CCollision::ProcessVerticalLine(line, e->GetMatrix(), *colmodel, point, dist,
ignoreSeeThrough, poly))
ignoreSeeThrough, false, poly))
entity = e;
}
}
@ -637,7 +639,7 @@ CWorld::GetIsLineOfSightSectorListClear(CPtrList &list, const CColLine &line, bo
colmodel = CModelInfo::GetModelInfo(e->GetModelIndex())->GetColModel();
if(CCollision::TestLineOfSight(line, e->GetMatrix(), *colmodel, ignoreSeeThrough))
if(CCollision::TestLineOfSight(line, e->GetMatrix(), *colmodel, ignoreSeeThrough, false))
return false;
}
}

View file

@ -71,6 +71,7 @@ public:
static bool bProcessCutsceneOnly;
static bool bDoingCarCollisions;
static bool bIncludeCarTyres;
static CColPoint m_aTempColPts[MAX_COLLISION_POINTS];
static void Remove(CEntity *entity);
static void Add(CEntity *entity);
@ -90,9 +91,9 @@ public:
static bool CameraToIgnoreThisObject(CEntity *ent);
static bool ProcessLineOfSight(const CVector &point1, const CVector &point2, CColPoint &point, CEntity *&entity, bool checkBuildings, bool checkVehicles, bool checkPeds, bool checkObjects, bool checkDummies, bool ignoreSeeThrough, bool ignoreSomeObjects = false);
static bool ProcessLineOfSightSector(CSector &sector, const CColLine &line, CColPoint &point, float &dist, CEntity *&entity, bool checkBuildings, bool checkVehicles, bool checkPeds, bool checkObjects, bool checkDummies, bool ignoreSeeThrough, bool ignoreSomeObjects = false);
static bool ProcessLineOfSightSectorList(CPtrList &list, const CColLine &line, CColPoint &point, float &dist, CEntity *&entity, bool ignoreSeeThrough, bool ignoreSomeObjects = false);
static bool ProcessLineOfSight(const CVector &point1, const CVector &point2, CColPoint &point, CEntity *&entity, bool checkBuildings, bool checkVehicles, bool checkPeds, bool checkObjects, bool checkDummies, bool ignoreSeeThrough, bool ignoreSomeObjects = false, bool ignoreShootThrough = false);
static bool ProcessLineOfSightSector(CSector &sector, const CColLine &line, CColPoint &point, float &dist, CEntity *&entity, bool checkBuildings, bool checkVehicles, bool checkPeds, bool checkObjects, bool checkDummies, bool ignoreSeeThrough, bool ignoreSomeObjects, bool ignoreShootThrough);
static bool ProcessLineOfSightSectorList(CPtrList &list, const CColLine &line, CColPoint &point, float &dist, CEntity *&entity, bool ignoreSeeThrough, bool ignoreSomeObjects, bool ignoreShootThrough);
static bool ProcessVerticalLine(const CVector &point1, float z2, CColPoint &point, CEntity *&entity, bool checkBuildings, bool checkVehicles, bool checkPeds, bool checkObjects, bool checkDummies, bool ignoreSeeThrough, CStoredCollPoly *poly);
static bool ProcessVerticalLineSector(CSector &sector, const CColLine &line, CColPoint &point, CEntity *&entity, bool checkBuildings, bool checkVehicles, bool checkPeds, bool checkObjects, bool checkDummies, bool ignoreSeeThrough, CStoredCollPoly *poly);
static bool ProcessVerticalLineSectorList(CPtrList &list, const CColLine &line, CColPoint &point, float &dist, CEntity *&entity, bool ignoreSeeThrough, CStoredCollPoly *poly);

View file

@ -273,7 +273,7 @@ DebugMenuPopulate(void)
{
if(1){
static const char *weathers[] = {
"Sunny", "Cloudy", "Rainy", "Foggy"
"Sunny", "Cloudy", "Rainy", "Foggy", "Extrasunny", "Stormy"
};
DebugMenuEntry *e;
e = DebugMenuAddVar("Time & Weather", "Current Hour", &CClock::GetHoursRef(), nil, 1, 0, 23, nil);
@ -281,9 +281,9 @@ DebugMenuPopulate(void)
e = DebugMenuAddVar("Time & Weather", "Current Minute", &CClock::GetMinutesRef(),
[](){ CWeather::InterpolationValue = CClock::GetMinutes()/60.0f; }, 1, 0, 59, nil);
DebugMenuEntrySetWrap(e, true);
e = DebugMenuAddVar("Time & Weather", "Old Weather", (int16*)&CWeather::OldWeatherType, nil, 1, 0, 3, weathers);
e = DebugMenuAddVar("Time & Weather", "Old Weather", (int16*)&CWeather::OldWeatherType, nil, 1, 0, 5, weathers);
DebugMenuEntrySetWrap(e, true);
e = DebugMenuAddVar("Time & Weather", "New Weather", (int16*)&CWeather::NewWeatherType, nil, 1, 0, 3, weathers);
e = DebugMenuAddVar("Time & Weather", "New Weather", (int16*)&CWeather::NewWeatherType, nil, 1, 0, 5, weathers);
DebugMenuEntrySetWrap(e, true);
DebugMenuAddVar("Time & Weather", "Wind", (float*)&CWeather::Wind, nil, 0.1f, 0.0f, 1.0f);
DebugMenuAddVar("Time & Weather", "Time scale", (float*)&CTimer::GetTimeScale(), nil, 0.1f, 0.0f, 10.0f);
@ -337,7 +337,11 @@ DebugMenuPopulate(void)
DebugMenuAddCmd("Spawn", "Spawn Banshee", [](){ SpawnCar(MI_BANSHEE); });
DebugMenuAddCmd("Spawn", "Spawn Cuban", [](){ SpawnCar(MI_CUBAN); });
DebugMenuAddCmd("Spawn", "Spawn Voodoo", [](){ SpawnCar(MI_VOODOO); });
DebugMenuAddCmd("Spawn", "Spawn Maverick", [](){ SpawnCar(MI_MAVERICK); });
DebugMenuAddCmd("Spawn", "Spawn VCN Maverick", [](){ SpawnCar(MI_VCNMAV); });
DebugMenuAddCmd("Spawn", "Spawn Sparrow", [](){ SpawnCar(MI_SPARROW); });
DebugMenuAddCmd("Spawn", "Spawn Sea Sparrow", [](){ SpawnCar(MI_SEASPAR); });
DebugMenuAddCmd("Spawn", "Spawn Hunter", [](){ SpawnCar(MI_HUNTER); });
DebugMenuAddCmd("Spawn", "Spawn Rhino", [](){ SpawnCar(MI_RHINO); });
DebugMenuAddCmd("Spawn", "Spawn Firetruck", [](){ SpawnCar(MI_FIRETRUCK); });
DebugMenuAddCmd("Spawn", "Spawn Predator", [](){ SpawnCar(MI_PREDATOR); });

View file

@ -910,7 +910,7 @@ CEntity::ProcessLightsForEntity(void)
camDir *= 2.0f/dist;
glareDir += camDir;
glareDir.Normalise();
float camAngle = -DotProduct(glareDir, CTimeCycle::GetSunPosition());
float camAngle = -DotProduct(glareDir, CTimeCycle::GetSunDirection());
if(camAngle > 0.0f){
float intens = Sqrt(camAngle) * CWeather::SunGlare;
pos += camDir;

View file

@ -11,9 +11,7 @@ public:
float Magnitude(void) const { return Sqrt(x*x + y*y); }
float MagnitudeSqr(void) const { return x*x + y*y; }
void Normalise(void);
void NormaliseSafe(void) {
void Normalise(void) {
float sq = MagnitudeSqr();
if(sq > 0.0f){
float invsqrt = RecipSqrt(sq);

View file

@ -4,19 +4,6 @@
// TODO: move more stuff into here
void
CVector2D::Normalise(void)
{
float sq = MagnitudeSqr();
assert(sq != 0.0f); // just be safe here
//if(sq > 0.0f){
float invsqrt = RecipSqrt(sq);
x *= invsqrt;
y *= invsqrt;
//}else
// x = 1.0f;
}
void
CMatrix::SetRotate(float xAngle, float yAngle, float zAngle)
{

View file

@ -302,7 +302,8 @@ enum
MI_TRAIN = -1,
MI_DODO = -2,
MI_NIGHTSTICK = 262,
MI_GOLFCLUB = 261,
MI_NIGHTSTICK,
MI_KNIFE,
MI_BASEBALL_BAT,
MI_GRENADE = 270,

View file

@ -66,7 +66,7 @@
CPed *gapTempPedList[50];
uint16 gnNumTempPedList;
CColPoint aTempPedColPts[MAX_COLLISION_POINTS];
static CColPoint aTempPedColPts[MAX_COLLISION_POINTS];
// TODO(Miami)
#define AUDIO_NOT_READY
@ -4558,7 +4558,8 @@ CPed::InflictDamage(CEntity *damagedBy, eWeaponType method, float damage, ePedPi
m_pMyVehicle->AutoPilot.m_nTempAction = TEMPACT_HANDBRAKESTRAIGHT;
m_pMyVehicle->AutoPilot.m_nTimeTempAction = CTimer::GetTimeInMilliseconds() + 2000;
}
if (m_pMyVehicle->CanPedExitCar()) {
// TODO(MIAMI): argument
if (m_pMyVehicle->CanPedExitCar(false)) {
SetObjective(OBJECTIVE_LEAVE_CAR_AND_DIE, m_pMyVehicle);
} else {
m_fHealth = 0.0f;
@ -13372,7 +13373,8 @@ CPed::ProcessObjective(void)
} else {
bool targetHasVeh = m_pedInObjective->bInVehicle;
if (!targetHasVeh
|| targetHasVeh && m_pedInObjective->m_pMyVehicle->CanPedExitCar()) {
// TODO(MIAMI): argument
|| targetHasVeh && m_pedInObjective->m_pMyVehicle->CanPedExitCar(false)) {
m_pMyVehicle->AutoPilot.m_nCruiseSpeed = 0;
m_pMyVehicle->AutoPilot.m_nCarMission = MISSION_NONE;
SetObjective(OBJECTIVE_LEAVE_VEHICLE, m_pMyVehicle);
@ -15427,13 +15429,13 @@ CPed::ProcessEntityCollision(CEntity *collidingEnt, CColPoint *collidingPoints)
}
float minDist = 1.0f;
belowTorsoCollided = CCollision::ProcessVerticalLine(ourLine, collidingEnt->GetMatrix(), *hisCol,
intersectionPoint, minDist, false, &m_collPoly);
intersectionPoint, minDist, false, false, &m_collPoly);
if (collidedWithBoat && bWasStanding && !belowTorsoCollided) {
ourLine.p0.z = ourLine.p1.z;
ourLine.p1.z = ourLine.p1.z + gravityEffect;
belowTorsoCollided = CCollision::ProcessVerticalLine(ourLine, collidingEnt->GetMatrix(), *hisCol,
intersectionPoint, minDist, false, &m_collPoly);
intersectionPoint, minDist, false, false, &m_collPoly);
}
if (belowTorsoCollided) {
#ifndef VC_PED_PORTS
@ -16151,7 +16153,8 @@ CPed::SetExitCar(CVehicle *veh, uint32 wantedDoorNode)
uint32 optedDoorNode = wantedDoorNode;
bool teleportNeeded = false;
bool isLow = !!veh->bLowVehicle;
if (!veh->CanPedExitCar()) {
// TODO(MIAMI): argument
if (!veh->CanPedExitCar(false)) {
if (veh->pDriver && !veh->pDriver->IsPlayer()) {
veh->AutoPilot.m_nCruiseSpeed = 0;
veh->AutoPilot.m_nCarMission = MISSION_NONE;

View file

@ -447,7 +447,7 @@ public:
uint32 bIsDrowning : 1;
uint32 bDrownsInWater : 1;
//uint32 b156_4
//uint32 b156_8
uint32 b156_8 : 1;
uint32 bIsPlayerFriend : 1;
#ifdef VC_PED_PORTS
uint32 bHeadStuckInCollision : 1;
@ -864,6 +864,7 @@ public:
static void PedSetDraggedOutCarPositionCB(CAnimBlendAssociation *assoc, void *arg);
bool IsPlayer(void);
bool IsFemale(void) { return m_nPedType == PEDTYPE_CIVFEMALE || m_nPedType == PEDTYPE_PROSTITUTE; }
bool UseGroundColModel(void);
bool CanSetPedState(void);
bool IsPedInControl(void);

View file

@ -509,18 +509,18 @@ CCoronas::DoSunAndMoon(void)
{
// yeah, moon is done somewhere else....
CVector sunCoors = CTimeCycle::GetSunPosition();
CVector sunCoors = CTimeCycle::GetSunDirection();
sunCoors *= 150.0f;
sunCoors += TheCamera.GetPosition();
if(CTimeCycle::GetSunPosition().z > -0.2f){
if(CTimeCycle::GetSunDirection().z > -0.2f){
float size = ((CGeneral::GetRandomNumber()&0xFF) * 0.005f + 10.0f) * CTimeCycle::GetSunSize();
RegisterCorona(SUN_CORE,
CTimeCycle::GetSunCoreRed(), CTimeCycle::GetSunCoreGreen(), CTimeCycle::GetSunCoreBlue(),
255, sunCoors, size,
999999.88f, TYPE_STAR, FLARE_NONE, REFLECTION_OFF, LOSCHECK_OFF, STREAK_OFF, 0.0f);
if(CTimeCycle::GetSunPosition().z > 0.0f)
if(CTimeCycle::GetSunDirection().z > 0.0f)
RegisterCorona(SUN_CORONA,
CTimeCycle::GetSunCoronaRed(), CTimeCycle::GetSunCoronaGreen(), CTimeCycle::GetSunCoronaBlue(),
255, sunCoors, 25.0f * CTimeCycle::GetSunSize(),

View file

@ -643,12 +643,12 @@ CShadows::StoreShadowForPole(CEntity *pPole, float fOffsetX, float fOffsetY, flo
PolePos.y += fOffsetX * pPole->GetRight().y + fOffsetY * pPole->GetForward().y;
PolePos.z += fOffsetZ;
PolePos.x += -CTimeCycle::GetSunPosition().x * (fPoleHeight / 2);
PolePos.y += -CTimeCycle::GetSunPosition().y * (fPoleHeight / 2);
PolePos.x += -CTimeCycle::GetSunDirection().x * (fPoleHeight / 2);
PolePos.y += -CTimeCycle::GetSunDirection().y * (fPoleHeight / 2);
StoreStaticShadow((uintptr)pPole + nID + _TODOCONST(51), SHADOWTYPE_DARK, gpPostShadowTex, &PolePos,
-CTimeCycle::GetSunPosition().x * (fPoleHeight / 2),
-CTimeCycle::GetSunPosition().y * (fPoleHeight / 2),
-CTimeCycle::GetSunDirection().x * (fPoleHeight / 2),
-CTimeCycle::GetSunDirection().y * (fPoleHeight / 2),
CTimeCycle::GetShadowSideX() * fPoleWidth,
CTimeCycle::GetShadowSideY() * fPoleWidth,
2 * (int32)((pPole->GetUp().z - 0.5f) * CTimeCycle::GetShadowStrength() * 2.0f) / 3,

View file

@ -199,8 +199,8 @@ CSkidmarks::RegisterOne(uintptr id, CVector pos, float fwdX, float fwdY, bool *i
aSkidmarks[i].m_pos[aSkidmarks[i].m_last] = pos;
CVector2D dist = aSkidmarks[i].m_pos[aSkidmarks[i].m_last] - aSkidmarks[i].m_pos[aSkidmarks[i].m_last-1];
dist.NormaliseSafe();
fwd.NormaliseSafe();
dist.Normalise();
fwd.Normalise();
CVector2D right(dist.y, -dist.x);
float turn = DotProduct2D(fwd, right);
turn = Abs(turn) + 1.0f;

View file

@ -28,6 +28,7 @@ RwImVertexIndex StreakIndexList[12];
RwIm3DVertex TraceVertices[6];
RwImVertexIndex TraceIndexList[12];
bool CSpecialFX::bSnapShotActive;
void
CSpecialFX::Init(void)

View file

@ -3,6 +3,8 @@
class CSpecialFX
{
public:
static bool bSnapShotActive;
static void Render(void);
static void Update(void);
static void Init(void);

View file

@ -350,7 +350,7 @@ CTimeCycle::Update(void)
m_CurrentStoredValue = (m_CurrentStoredValue+1)&0xF;
float sunAngle = 2*PI*(CClock::GetSeconds()/60.0f + CClock::GetMinutes() + CClock::GetHours()*60)/(24*60);
CVector &sunPos = GetSunPosition();
CVector &sunPos = GetSunDirection();
sunPos.x = Sin(sunAngle);
sunPos.y = 1.0f;
sunPos.z = 0.2f - Cos(sunAngle);

View file

@ -180,7 +180,7 @@ public:
static void Initialise(void);
static void Update(void);
static CVector &GetSunPosition(void) { return m_VectorToSun[m_CurrentStoredValue]; }
static CVector &GetSunDirection(void) { return m_VectorToSun[m_CurrentStoredValue]; }
static float GetShadowFrontX(void) { return m_fShadowFrontX[m_CurrentStoredValue]; }
static float GetShadowFrontY(void) { return m_fShadowFrontY[m_CurrentStoredValue]; }
static float GetShadowSideX(void) { return m_fShadowSideX[m_CurrentStoredValue]; }

View file

@ -18,6 +18,7 @@
#include "Vehicle.h"
#include "World.h"
#include "ZoneCull.h"
#include "SpecialFX.h"
int32 CWeather::SoundHandle = -1;
@ -271,9 +272,10 @@ void CWeather::Update(void)
SunGlare += InterpolationValue;
if (SunGlare > 0.0f) {
SunGlare *= Min(1.0f, 7.0 * CTimeCycle::GetSunPosition().z);
SunGlare *= Min(1.0f, 7.0 * CTimeCycle::GetSunDirection().z);
SunGlare = clamp(SunGlare, 0.0f, 1.0f);
// TODO(MIAMI): if (CSpecialFX::bSnapShotActive)...
if (!CSpecialFX::bSnapShotActive)
SunGlare *= (1.0f - (CGeneral::GetRandomNumber()&0x1F)*0.007f);
}
Wind = InterpolationValue * Windiness[NewWeatherType] + (1.0f - InterpolationValue) * Windiness[OldWeatherType];

View file

@ -77,6 +77,7 @@ CAutomobile::CAutomobile(int32 id, uint8 CreatedBy)
SetModelIndex(id);
pHandling = mod_HandlingManager.GetHandlingData((eHandlingId)mi->m_handlingId);
pFlyingHandling = mod_HandlingManager.GetFlyingPointer((eHandlingId)mi->m_handlingId);
field_49C = 20.0f;
field_4D8 = 0;
@ -176,7 +177,7 @@ CAutomobile::CAutomobile(int32 id, uint8 CreatedBy)
m_nNumPassengers = 0;
m_bombType = CARBOMB_NONE;
bHadDriver = false;
bDriverLastFrame = false;
m_pBombRigger = nil;
if(m_nDoorLock == CARLOCK_UNLOCKED &&
@ -272,25 +273,14 @@ CAutomobile::ProcessControl(void)
}
// Process driver
if(pDriver){
if(!bHadDriver && m_bombType == CARBOMB_ONIGNITIONACTIVE){
// If someone enters the car and there is a bomb, detonate
m_nBombTimer = 1000;
m_pBlowUpEntity = m_pBombRigger;
if(m_pBlowUpEntity)
m_pBlowUpEntity->RegisterReference((CEntity**)&m_pBlowUpEntity);
DMAudio.PlayOneShot(m_audioEntityId, SOUND_BOMB_TICK, 1.0f);
}
bHadDriver = true;
if(IsUpsideDown() && CanPedEnterCar()){
if(!pDriver->IsPlayer() &&
!(pDriver->m_leader && pDriver->m_leader->bInVehicle) &&
pDriver->CharCreatedBy != MISSION_CHAR)
pDriver->SetObjective(OBJECTIVE_LEAVE_VEHICLE, this);
}
}else
bHadDriver = false;
ActivateBombWhenEntered();
// Process passengers
if(m_nNumPassengers != 0 && IsUpsideDown() && CanPedEnterCar()){
@ -304,18 +294,7 @@ CAutomobile::ProcessControl(void)
CRubbish::StirUp(this);
// blend in clump
int clumpAlpha = CVisibilityPlugins::GetClumpAlpha((RpClump*)m_rwObject);
if(bFadeOut){
clumpAlpha -= 8;
if(clumpAlpha < 0)
clumpAlpha = 0;
}else if(clumpAlpha < 255){
clumpAlpha += 16;
if(clumpAlpha > 255)
clumpAlpha = 255;
}
CVisibilityPlugins::SetClumpAlpha((RpClump*)m_rwObject, clumpAlpha);
UpdateClumpAlpha();
AutoPilot.m_bSlowedDownBecauseOfCars = false;
AutoPilot.m_bSlowedDownBecauseOfPeds = false;
@ -726,19 +705,8 @@ CAutomobile::ProcessControl(void)
traction *= 4.0f;
if(FindPlayerVehicle() && FindPlayerVehicle() == this){
if(CPad::GetPad(0)->WeaponJustDown()){
if(m_bombType == CARBOMB_TIMED){
m_bombType = CARBOMB_TIMEDACTIVE;
m_nBombTimer = 7000;
m_pBlowUpEntity = FindPlayerPed();
CGarages::TriggerMessage("GA_12", -1, 3000, -1);
DMAudio.PlayOneShot(m_audioEntityId, SOUND_BOMB_TIMED_ACTIVATED, 1.0f);
}else if(m_bombType == CARBOMB_ONIGNITION){
m_bombType = CARBOMB_ONIGNITIONACTIVE;
CGarages::TriggerMessage("GA_12", -1, 3000, -1);
DMAudio.PlayOneShot(m_audioEntityId, SOUND_BOMB_ONIGNITION_ACTIVATED, 1.0f);
}
}
if(CPad::GetPad(0)->WeaponJustDown())
ActivateBomb();
}else if(strongGrip1 || CVehicle::bCheat3){
traction *= 1.2f;
acceleration *= 1.4f;
@ -1934,6 +1902,8 @@ CAutomobile::PreRender(void)
}
CShadows::StoreShadowForCar(this);
DoSunGlare();
}
void
@ -3939,7 +3909,7 @@ CAutomobile::SetUpWheelColModel(CColModel *colModel)
if(m_aCarNodes[CAR_WHEEL_LM] != nil && m_aCarNodes[CAR_WHEEL_RM] != nil){
mat.Attach(RwFrameGetMatrix(m_aCarNodes[CAR_WHEEL_LM]));
colModel->spheres[4].Set(mi->m_wheelScale, mat.GetPosition(), SURFACE_TIRE, CAR_PIECE_WHEEL_RF);
colModel->spheres[4].Set(mi->m_wheelScale, mat.GetPosition(), SURFACE_TIRE, CAR_PIECE_WHEEL_LR);
mat.Attach(RwFrameGetMatrix(m_aCarNodes[CAR_WHEEL_RM]));
colModel->spheres[5].Set(mi->m_wheelScale, mat.GetPosition(), SURFACE_TIRE, CAR_PIECE_WHEEL_RR);
colModel->numSpheres = 6;
@ -3949,9 +3919,8 @@ CAutomobile::SetUpWheelColModel(CColModel *colModel)
return true;
}
// this probably isn't used in III yet
void
CAutomobile::BurstTyre(uint8 wheel)
CAutomobile::BurstTyre(uint8 wheel, bool applyForces)
{
switch(wheel){
case CAR_PIECE_WHEEL_LF: wheel = VEHWHEEL_FRONT_LEFT; break;
@ -3969,9 +3938,11 @@ CAutomobile::BurstTyre(uint8 wheel)
CCarCtrl::SwitchVehicleToRealPhysics(this);
}
if(applyForces){
ApplyMoveForce(GetRight() * CGeneral::GetRandomNumberInRange(-0.3f, 0.3f));
ApplyTurnForce(GetRight() * CGeneral::GetRandomNumberInRange(-0.3f, 0.3f), GetForward());
}
}
}
bool
@ -4337,7 +4308,7 @@ GetCurrentAtomicObjectCB(RwObject *object, void *data)
return object;
}
CColPoint spherepoints[MAX_COLLISION_POINTS];
static CColPoint aTempPedColPts[MAX_COLLISION_POINTS];
CObject*
CAutomobile::SpawnFlyingComponent(int32 component, uint32 type)
@ -4457,7 +4428,7 @@ CAutomobile::SpawnFlyingComponent(int32 component, uint32 type)
if(CCollision::ProcessColModels(obj->GetMatrix(), *obj->GetColModel(),
this->GetMatrix(), *this->GetColModel(),
spherepoints, nil, nil) > 0)
aTempPedColPts, nil, nil) > 0)
obj->m_pCollidingEntity = this;
if(bRenderScorched)

View file

@ -83,9 +83,10 @@ public:
float m_aWheelRotation[4];
float m_aWheelPosition[4];
float m_aWheelSpeed[4];
float m_fRotorSpeed;
uint8 field_4D8;
uint8 bTaxiLight : 1;
uint8 bHadDriver : 1; // for bombs
//uint8 bHadDriver : 1; // for bombs
uint8 bFixedColour : 1;
uint8 bBigWheels : 1;
uint8 bWaterTight : 1; // no damage for non-player peds
@ -146,7 +147,7 @@ public:
void RemoveRefsToVehicle(CEntity *ent);
void BlowUpCar(CEntity *ent);
bool SetUpWheelColModel(CColModel *colModel);
void BurstTyre(uint8 tyre);
void BurstTyre(uint8 tyre, bool applyForces);
bool IsRoomForPedToLeaveCar(uint32 component, CVector *doorOffset);
float GetHeightAboveRoad(void);
void PlayCarHorn(void);

View file

@ -558,60 +558,8 @@ CHeli::ProcessControl(void)
void
CHeli::PreRender(void)
{
float angle;
uint8 i;
CColPoint point;
CEntity *entity;
uint8 r, g, b;
float testLowZ = FindPlayerCoors().z - 10.0f;
float radius = (GetPosition().z - FindPlayerCoors().z - 10.0f - 1.0f) * 0.3f + 10.0f;
int frm = CTimer::GetFrameCounter() & 7;
i = 0;
for(angle = 0.0f; angle < TWOPI; angle += TWOPI/32){
CVector pos(radius*Cos(angle), radius*Sin(angle), 0.0f);
CVector dir = pos*0.01f;
pos += GetPosition();
if(CWorld::ProcessVerticalLine(pos, testLowZ, point, entity, true, false, false, false, true, false, nil))
m_fHeliDustZ[frm] = point.point.z;
else
m_fHeliDustZ[frm] = -101.0f;
switch(point.surfaceB){
default:
case SURFACE_TARMAC:
r = 10;
g = 10;
b = 10;
break;
case SURFACE_GRASS:
r = 10;
g = 6;
b = 3;
break;
case SURFACE_DIRT:
r = 10;
g = 8;
b = 7;
break;
case SURFACE_DIRTTRACK:
r = 10;
g = 6;
b = 3;
break;
}
RwRGBA col = { r, g, b, 32 };
#ifdef FIX_BUGS
pos.z = m_fHeliDustZ[frm];
#else
// What the hell is the point of this?
pos.z = m_fHeliDustZ[(i - (i&3))/4]; // advance every 4 iterations, why not just /4?
#endif
if(pos.z > -200.0f && GetPosition().z - pos.z < 20.0f)
CParticle::AddParticle(PARTICLE_HELI_DUST, pos, dir, nil, 0.0f, col);
i++;
}
HeliDustGenerate(this, radius, FindPlayerCoors().z, Max(16.0f - 4.0f*CTimer::GetTimeStep(), 2.0f));
}
void

File diff suppressed because it is too large Load diff

View file

@ -8,6 +8,8 @@
#include "HandlingMgr.h"
class CPed;
class CPlayerPed;
class CCopPed;
class CFire;
struct tHandlingData;
@ -87,8 +89,8 @@ enum
CAR_PIECE_WING_LR,
CAR_PIECE_WING_RR,
CAR_PIECE_WHEEL_LF,
CAR_PIECE_WHEEL_LR,
CAR_PIECE_WHEEL_RF,
CAR_PIECE_WHEEL_LR,
CAR_PIECE_WHEEL_RR,
CAR_PIECE_WINDSCREEN,
};
@ -104,10 +106,12 @@ enum tWheelState
enum eFlightModel
{
FLIGHT_MODEL_DODO,
// not used in III
FLIGHT_MODEL_RCPLANE,
FLIGHT_MODEL_HELI,
FLIGHT_MODEL_SEAPLANE
FLIGHT_MODEL_RCHELI,
FLIGHT_MODEL_SEAPLANE,
FLIGHT_MODEL_PLANE_UNUSED,
FLIGHT_MODEL_PLANE,
FLIGHT_MODEL_HELI
};
enum eVehicleAppearance
@ -120,10 +124,28 @@ enum eVehicleAppearance
VEHICLE_APPEARANCE_PLANE,
};
// TODO
enum eBikeWheelSpecial
{
BIKE_WHEEL_2 = 2,
BIKE_WHEEL_3,
};
enum
{
ROTOR_TOP = 3,
ROTOR_FRONT = 4,
ROTOR_RIGHT = 5,
ROTOR_LEFT = 7,
ROTOR_BACK = 8,
ROTOR_BOTTOM = 9,
};
class CVehicle : public CPhysical
{
public:
tHandlingData *pHandling;
tFlyingHandlingData *pFlyingHandling;
CAutoPilot AutoPilot;
uint8 m_currentColour1;
uint8 m_currentColour2;
@ -180,28 +202,28 @@ public:
uint8 bHasAlreadyBeenRecorded : 1; // Used for replays
uint8 bPartOfConvoy : 1;
uint8 bHeliMinimumTilt : 1; // This heli should have almost no tilt really
//uint8 bAudioChangingGear : 1; // sounds like vehicle is changing gear
uint8 bAudioChangingGear : 1; // sounds like vehicle is changing gear
uint8 bIsDrowning : 1; // is vehicle occupants taking damage in water (i.e. vehicle is dead in water)
uint8 bTyresDontBurst : 1; // If this is set the tyres are invincible
uint8 bCreatedAsPoliceVehicle : 1;// True if this guy was created as a police vehicle (enforcer, policecar, miamivice car etc)
uint8 bRestingOnPhysical : 1; // Dont go static cause car is sitting on a physical object that might get removed
uint8 bParking : 1;
//uint8 bCanPark : 1;
uint8 bCanPark : 1;
uint8 m_bombType : 3;
uint8 bDriverLastFrame : 1;
int8 m_numPedsUseItAsCover;
uint8 m_nAmmoInClip; // Used to make the guns on boat do a reload (20 by default)
int8 m_nPacManPickupsCarried;
uint8 m_nRoadblockType;
int16 m_nRoadblockNode;
float m_fHealth; // 1000.0f = full health. 250.0f = fire. 0 -> explode
uint8 m_nCurrentGear;
float m_fChangeGearTime;
CEntity* m_pBombRigger;
uint32 m_nGunFiringTime; // last time when gun on vehicle was fired (used on boats)
uint32 m_nSetPieceExtendedRangeTime;
uint32 m_nGunFiringTime; // last time when gun on vehicle was fired (used on boats)
uint32 m_nTimeOfDeath;
uint16 m_nTimeBlocked;
int16 m_nBombTimer; // goes down with each frame
@ -214,7 +236,7 @@ public:
int8 m_nRadioStation;
uint8 m_bRainAudioCounter;
uint8 m_bRainSamplesCounter;
uint8 m_nCarHornTimer;
uint32 m_nCarHornTimer;
uint8 m_nCarHornPattern;
bool m_bSirenOrAlarm;
uint8 m_nCarHornDelay;
@ -247,11 +269,15 @@ public:
virtual bool IsDoorFullyOpen(eDoors door) { return false; }
virtual bool IsDoorClosed(eDoors door) { return false; }
virtual bool IsDoorMissing(eDoors door) { return false; }
virtual bool IsDoorReady(uint32 door) { return false; }
virtual bool IsDoorMissing(uint32 door) { return false; }
virtual bool IsOpenTopCar(void) { return false; }
virtual void RemoveRefsToVehicle(CEntity *ent) {}
virtual void BlowUpCar(CEntity *ent) {}
virtual bool SetUpWheelColModel(CColModel *colModel) { return false; }
virtual void BurstTyre(uint8 tyre) {}
virtual void BurstTyre(uint8 tyre, bool applyForces) {}
virtual bool IsRoomForPedToLeaveCar(uint32 component, CVector *forcedDoorPos) { return false;}
virtual bool IsClearToDriveAway(void);
virtual float GetHeightAboveRoad(void);
virtual void PlayCarHorn(void) {}
#ifdef COMPATIBLE_SAVES
@ -268,11 +294,17 @@ public:
bool IsBike(void) { return m_vehType == VEHICLE_TYPE_BIKE; }
void FlyingControl(eFlightModel flightModel);
bool DoBladeCollision(CVector pos, CMatrix &matrix, int16 rotorType, float radius, float damageMult);
bool BladeColSectorList(CPtrList &list, CColModel &rotorColModel, CMatrix &matrix, int16 rotorType, float damageMult);
void ProcessWheel(CVector &wheelFwd, CVector &wheelRight, CVector &wheelContactSpeed, CVector &wheelContactPoint,
int32 wheelsOnGround, float thrust, float brake, float adhesion, int8 wheelId, float *wheelSpeed, tWheelState *wheelState, uint16 wheelStatus);
void ProcessBikeWheel(CVector &wheelFwd, CVector &wheelRight, CVector &wheelContactSpeed, CVector &wheelContactPoint,
int32 wheelsOnGround, float thrust, float brake, float adhesion, float unk, int8 wheelId, float *wheelSpeed, tWheelState *wheelState, eBikeWheelSpecial special, uint16 wheelStatus);
void ExtinguishCarFire(void);
void ProcessDelayedExplosion(void);
float ProcessWheelRotation(tWheelState state, const CVector &fwd, const CVector &speed, float radius);
int FindTyreNearestPoint(float x, float y);
bool IsLawEnforcementVehicle(void);
void ChangeLawEnforcerState(uint8 enable);
bool UsesSiren(uint32 id);
@ -282,8 +314,10 @@ public:
bool IsOnItsSide(void);
bool CanBeDeleted(void);
bool CanPedOpenLocks(CPed *ped);
bool CanDoorsBeDamaged(void);
bool CanPedEnterCar(void);
bool CanPedExitCar(void);
bool CanPedExitCar(bool jumpExit);
bool CanPedJumpOffBike(void);
// do these two actually return something?
CPed *SetUpDriver(void);
CPed *SetupPassenger(int n);
@ -292,17 +326,31 @@ public:
bool AddPassenger(CPed *passenger, uint8 n);
void RemovePassenger(CPed *passenger);
void RemoveDriver(void);
bool IsDriver(CPed *ped);
bool IsDriver(int32 model);
bool IsPassenger(CPed *ped);
bool IsPassenger(int32 model);
void UpdatePassengerList(void);
void ProcessCarAlarm(void);
bool IsSphereTouchingVehicle(float sx, float sy, float sz, float radius);
bool ShufflePassengersToMakeSpace(void);
void InflictDamage(CEntity *damagedBy, eWeaponType weaponType, float damage);
void MakeNonDraggedPedsLeaveVehicle(CPed *ped1, CPed *ped2, CPlayerPed *&player, CCopPed *&cop);
void InflictDamage(CEntity *damagedBy, eWeaponType weaponType, float damage, CVector pos = CVector(0.0f, 0.0f, 0.0f));
void DoFixedMachineGuns(void);
void FireFixedMachineGuns(void);
void ActivateBomb(void);
void ActivateBombWhenEntered(void);
void SetComponentAtomicAlpha(RpAtomic *atomic, int32 alpha);
void UpdateClumpAlpha(void);
static void HeliDustGenerate(CEntity *heli, float radius, float ground, int rnd);
void DoSunGlare(void);
bool IsAlarmOn(void) { return m_nAlarmState != 0 && m_nAlarmState != -1; }
CVehicleModelInfo* GetModelInfo() { return (CVehicleModelInfo*)CModelInfo::GetModelInfo(GetModelIndex()); }
bool IsTaxi(void) { return GetModelIndex() == MI_TAXI || GetModelIndex() == MI_CABBIE || GetModelIndex() == MI_ZEBRA || GetModelIndex() == MI_KAUFMAN; }
bool IsLimo(void) { return GetModelIndex() == MI_STRETCH || GetModelIndex() == MI_LOVEFIST; }
bool IsRealHeli(void) { return !!(pHandling->Flags & HANDLING_IS_HELI); }
static bool bWheelsOnlyCheat;

View file

@ -1271,7 +1271,7 @@ CWeapon::DoBulletImpact(CEntity *shooter, CEntity *victim,
}
case ENTITY_TYPE_VEHICLE:
{
((CVehicle *)victim)->InflictDamage(shooter, m_eWeaponType, info->m_nDamage);
((CVehicle *)victim)->InflictDamage(shooter, m_eWeaponType, info->m_nDamage, point->point);
for ( int32 i = 0; i < 16; i++ )
CParticle::AddParticle(PARTICLE_SPARK, point->point, point->normal*0.05f);
@ -1648,7 +1648,7 @@ CWeapon::FireShotgun(CEntity *shooter, CVector *fireSource)
case ENTITY_TYPE_VEHICLE:
{
if (point.pieceB >= SURFACE_STREET_LIGHT && point.pieceB <= SURFACE_METAL_FENCE) {
((CVehicle*)victim)->BurstTyre(point.pieceB); // TODO(Miami): New parameter: ,true);
((CVehicle*)victim)->BurstTyre(point.pieceB, true);
for (int32 i = 0; i < 4; i++)
CParticle::AddParticle(PARTICLE_BULLETHIT_SMOKE, point.point, point.normal * 0.05f);