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

Fix sniper and water creatures bug, mark some files

This commit is contained in:
eray orçunus 2020-10-09 12:02:21 +03:00
parent ed82c55475
commit a01b14f301
12 changed files with 44 additions and 16 deletions

View file

@ -2,6 +2,8 @@
#include <ctype.h> #include <ctype.h>
// --MIAMI: file done
class CGeneral class CGeneral
{ {
public: public:

View file

@ -4,6 +4,8 @@
#include "World.h" #include "World.h"
#include "Dummy.h" #include "Dummy.h"
// --MIAMI: file done
void *CDummy::operator new(size_t sz) { return CPools::GetDummyPool()->New(); } void *CDummy::operator new(size_t sz) { return CPools::GetDummyPool()->New(); }
void CDummy::operator delete(void *p, size_t sz) { CPools::GetDummyPool()->Delete((CDummy*)p); } void CDummy::operator delete(void *p, size_t sz) { CPools::GetDummyPool()->Delete((CDummy*)p); }

View file

@ -3,6 +3,8 @@
#include "DummyObject.h" #include "DummyObject.h"
#include "Pools.h" #include "Pools.h"
// --MIAMI: file done
CDummyObject::CDummyObject(CObject *obj) CDummyObject::CDummyObject(CObject *obj)
{ {
SetModelIndexNoCreate(obj->GetModelIndex()); SetModelIndexNoCreate(obj->GetModelIndex());

View file

@ -36,6 +36,7 @@ CObject::CObject(void)
m_colour2 = 0; m_colour2 = 0;
m_colour1 = m_colour2; m_colour1 = m_colour2;
m_nBonusValue = 0; m_nBonusValue = 0;
// m_nCostValue = 0; // TODO(Miami)
bIsPickup = false; bIsPickup = false;
bPickupObjWithMessage = false; bPickupObjWithMessage = false;
bOutOfStock = false; bOutOfStock = false;
@ -44,8 +45,12 @@ CObject::CObject(void)
bHasBeenDamaged = false; bHasBeenDamaged = false;
m_nRefModelIndex = -1; m_nRefModelIndex = -1;
bUseVehicleColours = false; bUseVehicleColours = false;
// bIsStreetLight = false; // duplicate
m_pCurSurface = nil; m_pCurSurface = nil;
m_pCollidingEntity = nil; m_pCollidingEntity = nil;
m_nBeachballBounces = 0;
bIsStreetLight = false;
m_area = AREA_EVERYWHERE;
} }
CObject::CObject(int32 mi, bool createRW) CObject::CObject(int32 mi, bool createRW)
@ -138,12 +143,16 @@ CObject::Render(void)
bool bool
CObject::SetupLighting(void) CObject::SetupLighting(void)
{ {
DeActivateDirectional();
SetAmbientColours();
if(bRenderScorched){ if(bRenderScorched){
WorldReplaceNormalLightsWithScorched(Scene.world, 0.1f); WorldReplaceNormalLightsWithScorched(Scene.world, 0.1f);
return true; return true;
} else if (bIsPickup) {
SetFullAmbient();
return true;
} else if (bIsWeapon) {
ActivateDirectional();
SetAmbientColoursForPedsCarsAndObjects();
return true;
} }
return false; return false;
} }
@ -151,8 +160,10 @@ CObject::SetupLighting(void)
void void
CObject::RemoveLighting(bool reset) CObject::RemoveLighting(bool reset)
{ {
if(reset) if(reset) {
WorldReplaceScorchedLightsWithNormal(Scene.world); SetAmbientColours();
DeActivateDirectional();
}
} }
void void
@ -363,6 +374,8 @@ CObject::CanBeDeleted(void)
return true; return true;
case CUTSCENE_OBJECT: case CUTSCENE_OBJECT:
return false; return false;
case CONTROLLED_SUB_OBJECT:
return false;
default: default:
return true; return true;
} }

View file

@ -8,7 +8,7 @@ enum {
MISSION_OBJECT = 2, MISSION_OBJECT = 2,
TEMP_OBJECT = 3, TEMP_OBJECT = 3,
CUTSCENE_OBJECT = 4, CUTSCENE_OBJECT = 4,
ESCALATOR_OBJECT = 5, CONTROLLED_SUB_OBJECT = 5,
}; };
enum CollisionSpecialResponseCase enum CollisionSpecialResponseCase

View file

@ -2,6 +2,8 @@
#include "Projectile.h" #include "Projectile.h"
// --MIAMI: file done
CProjectile::CProjectile(int32 model) : CObject() CProjectile::CProjectile(int32 model) : CObject()
{ {
m_fMass = 1.0f; m_fMass = 1.0f;

View file

@ -23,7 +23,7 @@ CStingerSegment::CStingerSegment()
m_fBuoyancy = GRAVITY * m_fMass * 0.1f; m_fBuoyancy = GRAVITY * m_fMass * 0.1f;
bExplosionProof = true; bExplosionProof = true;
SetModelIndex(MI_PLC_STINGER); SetModelIndex(MI_PLC_STINGER);
ObjectCreatedBy = ESCALATOR_OBJECT; ObjectCreatedBy = CONTROLLED_SUB_OBJECT;
NumOfStingerSegments++; NumOfStingerSegments++;
} }

View file

@ -3,6 +3,8 @@
#include "main.h" #include "main.h"
#include "PedRoutes.h" #include "PedRoutes.h"
// --MIAMI: file done
CRouteNode gaRoutes[NUMPEDROUTES]; CRouteNode gaRoutes[NUMPEDROUTES];
void void

View file

@ -4,6 +4,8 @@
#include "FileMgr.h" #include "FileMgr.h"
#include "PedStats.h" #include "PedStats.h"
// --MIAMI: file done
CPedStats *CPedStats::ms_apPedStats[NUM_PEDSTATS]; CPedStats *CPedStats::ms_apPedStats[NUM_PEDSTATS];
void void

View file

@ -1358,7 +1358,7 @@ CEscalator::Update(void) {
if (m_pSteps[i]) { if (m_pSteps[i]) {
m_pSteps[i]->SetPosition(m_pos1); m_pSteps[i]->SetPosition(m_pos1);
CWorld::Add(m_pSteps[i]); CWorld::Add(m_pSteps[i]);
m_pSteps[i]->ObjectCreatedBy = ESCALATOR_OBJECT; m_pSteps[i]->ObjectCreatedBy = CONTROLLED_SUB_OBJECT;
} }
} }
} }

View file

@ -22,3 +22,4 @@ void SetAmbientColours(void);
void SetAmbientColoursForPedsCarsAndObjects(void); void SetAmbientColoursForPedsCarsAndObjects(void);
void SetAmbientColoursToIndicateRoadGroup(int i); void SetAmbientColoursToIndicateRoadGroup(int i);
void SetAmbientColours(RwRGBAReal *color); void SetAmbientColours(RwRGBAReal *color);
void SetFullAmbient(void);

View file

@ -1011,8 +1011,9 @@ CHeli::TestSniperCollision(CVector *line0, CVector *line1)
bool hit = false; bool hit = false;
for(i = 0; i < NUM_HELIS; i++){ for(i = 0; i < NUM_HELIS; i++){
if(pHelis[i] && !pHelis[i]->bBulletProof) {
CVector pilotPos = pHelis[i]->GetMatrix() * CVector(-0.43f, 1.49f, 1.5f); CVector pilotPos = pHelis[i]->GetMatrix() * CVector(-0.43f, 1.49f, 1.5f);
if(pHelis[i] && !pHelis[i]->bBulletProof && CCollision::DistToLine(line0, line1, &pilotPos) < 0.8f){ if(CCollision::DistToLine(line0, line1, &pilotPos) < 0.8f){
pHelis[i]->m_fAngularSpeed = CGeneral::GetRandomTrueFalse() ? 0.05f : -0.05f; pHelis[i]->m_fAngularSpeed = CGeneral::GetRandomTrueFalse() ? 0.05f : -0.05f;
pHelis[i]->m_heliStatus = HELI_STATUS_SHOT_DOWN; pHelis[i]->m_heliStatus = HELI_STATUS_SHOT_DOWN;
pHelis[i]->m_nExplosionTimer = CTimer::GetTimeInMilliseconds() + 9999999; pHelis[i]->m_nExplosionTimer = CTimer::GetTimeInMilliseconds() + 9999999;
@ -1021,6 +1022,7 @@ CHeli::TestSniperCollision(CVector *line0, CVector *line1)
hit = true; hit = true;
} }
} }
}
return hit; return hit;
} }