summaryrefslogtreecommitdiffstats
path: root/src/core/World.cpp
diff options
context:
space:
mode:
authoraap <aap@papnet.eu>2020-09-01 17:30:49 +0200
committerGitHub <noreply@github.com>2020-09-01 17:30:49 +0200
commit6fc6ed863547629abaade3f0fb9ef8f3251c5bcc (patch)
treec52cb6802ffbe2c23af63f8d20477a7bee814502 /src/core/World.cpp
parentMerge pull request #697 from erorcun/miami (diff)
parentfix melee car damage (diff)
downloadre3-6fc6ed863547629abaade3f0fb9ef8f3251c5bcc.tar
re3-6fc6ed863547629abaade3f0fb9ef8f3251c5bcc.tar.gz
re3-6fc6ed863547629abaade3f0fb9ef8f3251c5bcc.tar.bz2
re3-6fc6ed863547629abaade3f0fb9ef8f3251c5bcc.tar.lz
re3-6fc6ed863547629abaade3f0fb9ef8f3251c5bcc.tar.xz
re3-6fc6ed863547629abaade3f0fb9ef8f3251c5bcc.tar.zst
re3-6fc6ed863547629abaade3f0fb9ef8f3251c5bcc.zip
Diffstat (limited to 'src/core/World.cpp')
-rw-r--r--src/core/World.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/core/World.cpp b/src/core/World.cpp
index fb2dbad3..6d5e8a81 100644
--- a/src/core/World.cpp
+++ b/src/core/World.cpp
@@ -49,6 +49,7 @@ bool CWorld::bProcessCutsceneOnly;
bool CWorld::bDoingCarCollisions;
bool CWorld::bIncludeCarTyres;
+bool CWorld::bIncludeBikers;
CColPoint CWorld::m_aTempColPts[MAX_COLLISION_POINTS];
@@ -63,6 +64,7 @@ CWorld::Initialise()
bIncludeDeadPeds = false;
bForceProcessControl = false;
bIncludeCarTyres = false;
+ bIncludeBikers = false;
}
void
@@ -272,7 +274,9 @@ CWorld::ProcessLineOfSightSector(CSector &sector, const CColLine &line, CColPoin
{
float mindist = dist;
bool deadPeds = !!bIncludeDeadPeds;
+ bool bikers = !!bIncludeBikers;
bIncludeDeadPeds = false;
+ bIncludeBikers = false;
if(checkBuildings) {
ProcessLineOfSightSectorList(sector.m_lists[ENTITYLIST_BUILDINGS], line, point, mindist, entity,
@@ -290,11 +294,13 @@ CWorld::ProcessLineOfSightSector(CSector &sector, const CColLine &line, CColPoin
if(checkPeds) {
if(deadPeds) bIncludeDeadPeds = true;
+ if(bikers) bIncludeBikers = true;
ProcessLineOfSightSectorList(sector.m_lists[ENTITYLIST_PEDS], line, point, mindist, entity,
ignoreSeeThrough, false, ignoreShootThrough);
ProcessLineOfSightSectorList(sector.m_lists[ENTITYLIST_PEDS_OVERLAP], line, point, mindist, entity,
ignoreSeeThrough, false, ignoreShootThrough);
bIncludeDeadPeds = false;
+ bIncludeBikers = false;
}
if(checkObjects) {
@@ -312,6 +318,7 @@ CWorld::ProcessLineOfSightSector(CSector &sector, const CColLine &line, CColPoin
}
bIncludeDeadPeds = deadPeds;
+ bIncludeBikers = bikers;
if(mindist < dist) {
dist = mindist;
@@ -325,22 +332,24 @@ CWorld::ProcessLineOfSightSectorList(CPtrList &list, const CColLine &line, CColP
CEntity *&entity, bool ignoreSeeThrough, bool ignoreSomeObjects, bool ignoreShootThrough)
{
bool deadPeds = false;
+ bool bikers = false;
float mindist = dist;
CPtrNode *node;
CEntity *e;
CColModel *colmodel;
if(list.first && bIncludeDeadPeds && ((CEntity *)list.first->item)->IsPed()) deadPeds = true;
+ if(list.first && bIncludeBikers && ((CEntity *)list.first->item)->IsPed()) bikers = true;
for(node = list.first; node; node = node->next) {
e = (CEntity *)node->item;
- if(e->m_scanCode != GetCurrentScanCode() && e != pIgnoreEntity && (e->bUsesCollision || deadPeds) &&
+ if(e->m_scanCode != GetCurrentScanCode() && e != pIgnoreEntity && (e->bUsesCollision || deadPeds || bikers) &&
!(ignoreSomeObjects && CameraToIgnoreThisObject(e))) {
colmodel = nil;
e->m_scanCode = GetCurrentScanCode();
if(e->IsPed()) {
- if(e->bUsesCollision || deadPeds && ((CPed *)e)->m_nPedState == PED_DEAD) {
+ if(e->bUsesCollision || deadPeds && ((CPed *)e)->m_nPedState == PED_DEAD || bikers) {
colmodel = ((CPedModelInfo *)CModelInfo::GetModelInfo(e->GetModelIndex()))->AnimatePedColModelSkinned(e->GetClump());
} else
colmodel = nil;