mirror of
https://github.com/GTAmodding/re3.git
synced 2024-11-29 13:43:43 +00:00
Merge branch 'miami' into lcs
* miami: Pool fixes + peds not forming circle fix
This commit is contained in:
commit
19dd95a1cb
22 changed files with 132 additions and 75 deletions
|
@ -23,25 +23,25 @@ cAudioScriptObject::Reset()
|
|||
}
|
||||
|
||||
void *
|
||||
cAudioScriptObject::operator new(size_t sz)
|
||||
cAudioScriptObject::operator new(size_t sz) throw()
|
||||
{
|
||||
return CPools::GetAudioScriptObjectPool()->New();
|
||||
}
|
||||
|
||||
void *
|
||||
cAudioScriptObject::operator new(size_t sz, int handle)
|
||||
cAudioScriptObject::operator new(size_t sz, int handle) throw()
|
||||
{
|
||||
return CPools::GetAudioScriptObjectPool()->New(handle);
|
||||
}
|
||||
|
||||
void
|
||||
cAudioScriptObject::operator delete(void *p, size_t sz)
|
||||
cAudioScriptObject::operator delete(void *p, size_t sz) throw()
|
||||
{
|
||||
CPools::GetAudioScriptObjectPool()->Delete((cAudioScriptObject *)p);
|
||||
}
|
||||
|
||||
void
|
||||
cAudioScriptObject::operator delete(void *p, int handle)
|
||||
cAudioScriptObject::operator delete(void *p, int handle) throw()
|
||||
{
|
||||
CPools::GetAudioScriptObjectPool()->Delete((cAudioScriptObject *)p);
|
||||
}
|
||||
|
|
|
@ -12,10 +12,10 @@ public:
|
|||
|
||||
void Reset(); /// ok
|
||||
|
||||
static void* operator new(size_t);
|
||||
static void* operator new(size_t, int);
|
||||
static void operator delete(void*, size_t);
|
||||
static void operator delete(void*, int);
|
||||
static void* operator new(size_t) throw();
|
||||
static void* operator new(size_t, int) throw();
|
||||
static void operator delete(void*, size_t) throw();
|
||||
static void operator delete(void*, int) throw();
|
||||
|
||||
static void LoadAllAudioScriptObjects(uint8 *buf, uint32 size);
|
||||
static void SaveAllAudioScriptObjects(uint8 *buf, uint32 *size);
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
#include "Streaming.h"
|
||||
#include "Pools.h"
|
||||
|
||||
void *CBuilding::operator new(size_t sz) { return CPools::GetBuildingPool()->New(); }
|
||||
void CBuilding::operator delete(void *p, size_t sz) { CPools::GetBuildingPool()->Delete((CBuilding*)p); }
|
||||
void *CBuilding::operator new(size_t sz) throw() { return CPools::GetBuildingPool()->New(); }
|
||||
void CBuilding::operator delete(void *p, size_t sz) throw() { CPools::GetBuildingPool()->Delete((CBuilding*)p); }
|
||||
|
||||
void
|
||||
CBuilding::ReplaceWithNewModel(int32 id)
|
||||
|
|
|
@ -9,8 +9,8 @@ public:
|
|||
m_type = ENTITY_TYPE_BUILDING;
|
||||
bUsesCollision = true;
|
||||
}
|
||||
static void *operator new(size_t);
|
||||
static void operator delete(void*, size_t);
|
||||
static void *operator new(size_t) throw();
|
||||
static void operator delete(void*, size_t) throw();
|
||||
|
||||
void ReplaceWithNewModel(int32 id);
|
||||
|
||||
|
|
|
@ -4,5 +4,5 @@
|
|||
#include "Treadable.h"
|
||||
#include "Pools.h"
|
||||
|
||||
void *CTreadable::operator new(size_t sz) { return CPools::GetTreadablePool()->New(); }
|
||||
void CTreadable::operator delete(void *p, size_t sz) { CPools::GetTreadablePool()->Delete((CTreadable*)p); }
|
||||
void *CTreadable::operator new(size_t sz) throw() { return CPools::GetTreadablePool()->New(); }
|
||||
void CTreadable::operator delete(void *p, size_t sz) throw() { CPools::GetTreadablePool()->Delete((CTreadable*)p); }
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
class CTreadable : public CBuilding
|
||||
{
|
||||
public:
|
||||
static void *operator new(size_t);
|
||||
static void operator delete(void*, size_t);
|
||||
static void *operator new(size_t) throw();
|
||||
static void operator delete(void*, size_t) throw();
|
||||
|
||||
bool GetIsATreadable(void) { return true; }
|
||||
};
|
||||
|
|
|
@ -36,7 +36,7 @@ CColModel::~CColModel(void)
|
|||
|
||||
//--LCS: no pool used, but maybe we better keep it?
|
||||
void*
|
||||
CColModel::operator new(size_t)
|
||||
CColModel::operator new(size_t) throw()
|
||||
{
|
||||
CColModel* node = CPools::GetColModelPool()->New();
|
||||
assert(node);
|
||||
|
@ -44,7 +44,7 @@ CColModel::operator new(size_t)
|
|||
}
|
||||
|
||||
void
|
||||
CColModel::operator delete(void *p, size_t)
|
||||
CColModel::operator delete(void *p, size_t) throw()
|
||||
{
|
||||
CPools::GetColModelPool()->Delete((CColModel*)p);
|
||||
}
|
||||
|
|
|
@ -35,8 +35,8 @@ struct CColModel
|
|||
void SetLinkPtr(CLink<CColModel*>*);
|
||||
void GetTrianglePoint(CVector &v, int i) const;
|
||||
|
||||
void *operator new(size_t);
|
||||
void operator delete(void *p, size_t);
|
||||
void *operator new(size_t) throw();
|
||||
void operator delete(void *p, size_t) throw();
|
||||
CColModel& operator=(const CColModel& other);
|
||||
|
||||
bool Write(base::cRelocatableChunkWriter &writer, bool allocSpace);
|
||||
|
|
|
@ -1912,8 +1912,7 @@ CStreaming::RemoveCurrentZonesModels(void)
|
|||
if (ms_currentPedGrp != -1)
|
||||
for (i = 0; i < NUMMODELSPERPEDGROUP; i++) {
|
||||
ms_bIsPedFromPedGroupLoaded[i] = false;
|
||||
if (CPopulation::ms_pPedGroups[ms_currentPedGrp].models[i] != -1 &&
|
||||
CPopulation::ms_pPedGroups[ms_currentPedGrp].models[i] != MI_MALE01) {
|
||||
if (CPopulation::ms_pPedGroups[ms_currentPedGrp].models[i] != -1) {
|
||||
SetModelIsDeletable(CPopulation::ms_pPedGroups[ms_currentPedGrp].models[i]);
|
||||
SetModelTxdIsDeletable(CPopulation::ms_pPedGroups[ms_currentPedGrp].models[i]);
|
||||
}
|
||||
|
|
|
@ -452,6 +452,7 @@ CTheZones::GetZoneInfoForTimeOfDay(const CVector *pos, CZoneInfo *info)
|
|||
assert(d >= 0.0f && d <= 1.0f);
|
||||
n = 1.0f - d;
|
||||
}
|
||||
#ifdef FIX_BUGS
|
||||
info->carDensity = day->carDensity * d + night->carDensity * n;
|
||||
for(i = 0; i < ARRAY_SIZE(info->carThreshold); i++)
|
||||
info->carThreshold[i] = day->carThreshold[i] * d + night->carThreshold[i] * n;
|
||||
|
@ -465,6 +466,22 @@ CTheZones::GetZoneInfoForTimeOfDay(const CVector *pos, CZoneInfo *info)
|
|||
info->copPedThreshold = day->copPedThreshold * d + night->copPedThreshold * n;
|
||||
for(i = 0; i < ARRAY_SIZE(info->gangPedThreshold); i++)
|
||||
info->gangPedThreshold[i] = day->gangPedThreshold[i] * d + night->gangPedThreshold[i] * n;
|
||||
#else
|
||||
// This is a complete mess.
|
||||
info->carDensity = day->carDensity * n + night->carDensity * d;
|
||||
for(i = 0; i < ARRAY_SIZE(info->carThreshold); i++)
|
||||
info->carThreshold[i] = night->carThreshold[i] * d + night->carThreshold[i] * n;
|
||||
for(i = 0; i < ARRAY_SIZE(info->boatThreshold); i++)
|
||||
info->boatThreshold[i] = night->boatThreshold[i] * d + night->boatThreshold[i] * n;
|
||||
for(i = 0; i < ARRAY_SIZE(info->gangThreshold); i++)
|
||||
info->gangThreshold[i] = night->gangThreshold[i] * d + night->gangThreshold[i] * n;
|
||||
|
||||
info->copThreshold = night->copThreshold * d + night->copThreshold * n;
|
||||
info->pedDensity = night->pedDensity * d + night->pedDensity * n;
|
||||
info->copPedThreshold = night->copPedThreshold * d + night->copPedThreshold * n;
|
||||
for(i = 0; i < ARRAY_SIZE(info->gangPedThreshold); i++)
|
||||
info->gangPedThreshold[i] = night->gangPedThreshold[i] * d + night->gangPedThreshold[i] * n;
|
||||
#endif
|
||||
}
|
||||
if(CClock::GetIsTimeInRange(5, 19))
|
||||
info->pedGroup = day->pedGroup;
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
#include "World.h"
|
||||
#include "Dummy.h"
|
||||
|
||||
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 new(size_t sz) throw() { return CPools::GetDummyPool()->New(); }
|
||||
void CDummy::operator delete(void *p, size_t sz) throw() { CPools::GetDummyPool()->Delete((CDummy*)p); }
|
||||
|
||||
void
|
||||
CDummy::Add(void)
|
||||
|
|
|
@ -12,8 +12,8 @@ public:
|
|||
void Add(void);
|
||||
void Remove(void);
|
||||
|
||||
static void *operator new(size_t);
|
||||
static void operator delete(void*, size_t);
|
||||
static void *operator new(size_t) throw();
|
||||
static void operator delete(void*, size_t) throw();
|
||||
};
|
||||
|
||||
bool IsDummyPointerValid(CDummy* pDummy);
|
||||
|
|
|
@ -25,10 +25,32 @@ int16 CObject::nNoTempObjects;
|
|||
//int16 CObject::nBodyCastHealth = 1000;
|
||||
float CObject::fDistToNearestTree;
|
||||
|
||||
void *CObject::operator new(size_t sz) { return CPools::GetObjectPool()->New(); }
|
||||
void *CObject::operator new(size_t sz, int handle) { return CPools::GetObjectPool()->New(handle);};
|
||||
void CObject::operator delete(void *p, size_t sz) { CPools::GetObjectPool()->Delete((CObject*)p); }
|
||||
void CObject::operator delete(void *p, int handle) { CPools::GetObjectPool()->Delete((CObject*)p); }
|
||||
// Object pools tends to be full sometimes, let's free a temp. object in this case.
|
||||
#ifdef FIX_BUGS
|
||||
void *CObject::operator new(size_t sz) throw() {
|
||||
CObject *obj = CPools::GetObjectPool()->New();
|
||||
if (!obj) {
|
||||
CObjectPool *objectPool = CPools::GetObjectPool();
|
||||
for (int32 i = 0; i < objectPool->GetSize(); i++) {
|
||||
CObject *existing = objectPool->GetSlot(i);
|
||||
if (existing && existing->ObjectCreatedBy == TEMP_OBJECT) {
|
||||
int32 handle = objectPool->GetIndex(existing);
|
||||
CWorld::Remove(existing);
|
||||
delete existing;
|
||||
obj = objectPool->New(handle);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return obj;
|
||||
}
|
||||
#else
|
||||
void *CObject::operator new(size_t sz) throw() { return CPools::GetObjectPool()->New(); }
|
||||
#endif
|
||||
void *CObject::operator new(size_t sz, int handle) throw() { return CPools::GetObjectPool()->New(handle); };
|
||||
|
||||
void CObject::operator delete(void *p, size_t sz) throw() { CPools::GetObjectPool()->Delete((CObject*)p); }
|
||||
void CObject::operator delete(void *p, int handle) throw() { CPools::GetObjectPool()->Delete((CObject*)p); }
|
||||
|
||||
CObject::CObject(void)
|
||||
{
|
||||
|
|
|
@ -88,10 +88,10 @@ public:
|
|||
static int16 nNoTempObjects;
|
||||
static float fDistToNearestTree;
|
||||
|
||||
static void *operator new(size_t);
|
||||
static void *operator new(size_t, int);
|
||||
static void operator delete(void*, size_t);
|
||||
static void operator delete(void*, int);
|
||||
static void *operator new(size_t) throw();
|
||||
static void *operator new(size_t, int) throw();
|
||||
static void operator delete(void*, size_t) throw();
|
||||
static void operator delete(void*, int) throw();
|
||||
|
||||
CObject(void);
|
||||
CObject(int32, bool);
|
||||
|
|
|
@ -46,7 +46,14 @@ CStinger::Init(CPed *pPed)
|
|||
|
||||
pOwner = pPed;
|
||||
for (i = 0; i < NUM_STINGER_SEGMENTS; i++) {
|
||||
pSpikes[i] = new CStingerSegment;
|
||||
pSpikes[i] = new CStingerSegment();
|
||||
#ifdef FIX_BUGS
|
||||
if (!pSpikes[i]) {
|
||||
// Abort!! Pool is full
|
||||
Remove();
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
pSpikes[i]->bUsesCollision = false;
|
||||
}
|
||||
bIsDeployed = true;
|
||||
|
@ -77,8 +84,11 @@ CStinger::Remove()
|
|||
CStingerSegment *spikeSegment = pSpikes[i];
|
||||
|
||||
#ifdef FIX_BUGS
|
||||
CWorld::Remove(spikeSegment);
|
||||
delete spikeSegment;
|
||||
if (spikeSegment) {
|
||||
CWorld::Remove(spikeSegment);
|
||||
delete spikeSegment;
|
||||
pSpikes[i] = nil;
|
||||
}
|
||||
#else
|
||||
if (spikeSegment->m_entryInfoList.first != nil)
|
||||
spikeSegment->bRemoveFromWorld = true;
|
||||
|
@ -92,9 +102,15 @@ CStinger::Remove()
|
|||
void
|
||||
CStinger::Deploy(CPed *pPed)
|
||||
{
|
||||
// So total number of stingers allowed at the same time is 2, each by different CCopPed.
|
||||
if (NumOfStingerSegments < NUM_STINGER_SEGMENTS*2 && !pPed->bInVehicle && pPed->IsPedInControl()) {
|
||||
if (!bIsDeployed && RpAnimBlendClumpGetAssociation(pPed->GetClump(), ANIM_STD_THROW_UNDER) == nil) {
|
||||
Init(pPed);
|
||||
#ifdef FIX_BUGS
|
||||
// Above call won't set it to true no more when object pool is full
|
||||
if (!bIsDeployed)
|
||||
return;
|
||||
#endif
|
||||
pPed->SetPedState(PED_DEPLOY_STINGER);
|
||||
CAnimManager::AddAnimation(pPed->GetClump(), ASSOCGRP_STD, ANIM_STD_THROW_UNDER);
|
||||
}
|
||||
|
@ -167,6 +183,7 @@ CStinger::CheckForBurstTyres()
|
|||
}
|
||||
}
|
||||
|
||||
// Only called when bIsDeployed
|
||||
void
|
||||
CStinger::Process()
|
||||
{
|
||||
|
@ -232,10 +249,11 @@ CStinger::Process()
|
|||
break;
|
||||
case STINGERSTATE_REMOVE:
|
||||
Remove();
|
||||
break;
|
||||
}
|
||||
#ifdef FIX_BUGS
|
||||
if (bIsDeployed)
|
||||
return;
|
||||
#else
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
CheckForBurstTyres();
|
||||
}
|
|
@ -93,7 +93,7 @@ CCopPed::CCopPed(eCopType copType, int32 modifier) : CPed(PEDTYPE_COP)
|
|||
m_nHassleTimer = 0;
|
||||
field_61C = 0;
|
||||
field_624 = 0;
|
||||
m_pStinger = new CStinger;
|
||||
m_pStinger = new CStinger();
|
||||
SetWeaponLockOnTarget(nil);
|
||||
}
|
||||
|
||||
|
|
|
@ -53,10 +53,10 @@ bool CPed::bFannyMagnetCheat;
|
|||
bool CPed::bPedCheat3;
|
||||
CVector2D CPed::ms_vec2DFleePosition;
|
||||
|
||||
void *CPed::operator new(size_t sz) { return CPools::GetPedPool()->New(); }
|
||||
void *CPed::operator new(size_t sz, int handle) { return CPools::GetPedPool()->New(handle); }
|
||||
void CPed::operator delete(void *p, size_t sz) { CPools::GetPedPool()->Delete((CPed*)p); }
|
||||
void CPed::operator delete(void *p, int handle) { CPools::GetPedPool()->Delete((CPed*)p); }
|
||||
void *CPed::operator new(size_t sz) throw() { return CPools::GetPedPool()->New(); }
|
||||
void *CPed::operator new(size_t sz, int handle) throw() { return CPools::GetPedPool()->New(handle); }
|
||||
void CPed::operator delete(void *p, size_t sz) throw() { CPools::GetPedPool()->Delete((CPed*)p); }
|
||||
void CPed::operator delete(void *p, int handle) throw() { CPools::GetPedPool()->Delete((CPed*)p); }
|
||||
|
||||
float gfTommyFatness = 1.0f;
|
||||
|
||||
|
|
|
@ -708,10 +708,10 @@ public:
|
|||
float m_radiusToGuard;
|
||||
float m_fMaxHealth;
|
||||
|
||||
static void *operator new(size_t);
|
||||
static void *operator new(size_t, int);
|
||||
static void operator delete(void*, size_t);
|
||||
static void operator delete(void*, int);
|
||||
static void *operator new(size_t) throw();
|
||||
static void *operator new(size_t, int) throw();
|
||||
static void operator delete(void*, size_t) throw();
|
||||
static void operator delete(void*, int) throw();
|
||||
|
||||
CPed(uint32 pedType);
|
||||
~CPed(void);
|
||||
|
|
|
@ -1404,7 +1404,7 @@ CPopulation::PlaceGangMembersInFormation(ePedType pedType, int pedAmount, CVecto
|
|||
CPed *createdPeds[5];
|
||||
|
||||
if (!TheCamera.IsSphereVisible(coors, 3.0f) || MIN_CREATION_DIST * PedCreationDistMultiplier() <= (coors - FindPlayerPed()->GetPosition()).Magnitude2D()) {
|
||||
if (CPedPlacement::IsPositionClearForPed(coors, 3.0f, -1, 0)) {
|
||||
if (CPedPlacement::IsPositionClearForPed(coors, 3.0f, -1, nil)) {
|
||||
bool leaderFoundGround;
|
||||
float leaderGroundZ = CWorld::FindGroundZFor3DCoord(coors.x, coors.y, coors.z, &leaderFoundGround) + 1.0f;
|
||||
if (leaderFoundGround) {
|
||||
|
@ -1484,7 +1484,7 @@ CPopulation::PlaceGangMembersInCircle(ePedType pedType, int pedAmount, CVector c
|
|||
if (!TheCamera.IsSphereVisible(coors, circleR) ||
|
||||
MIN_CREATION_DIST * PedCreationDistMultiplier() <= (coors - FindPlayerPed()->GetPosition()).Magnitude2D()) {
|
||||
|
||||
if (CPedPlacement::IsPositionClearForPed(coors, circleR, -1, 0)) {
|
||||
if (CPedPlacement::IsPositionClearForPed(coors, circleR, -1, nil)) {
|
||||
int pedIdx = 0;
|
||||
CVector leaderPos;
|
||||
#ifdef FIX_BUGS
|
||||
|
@ -1528,9 +1528,9 @@ CPopulation::PlaceGangMembersInCircle(ePedType pedType, int pedAmount, CVector c
|
|||
}
|
||||
bool memberCanSeeLeader = createLeader ? true : CWorld::GetIsLineOfSightClear(finalPos, leaderPos, true, false, false, false, false, false, false);
|
||||
|
||||
bool notTooCloseToLeader = createLeader ? true : !(Abs(finalPos.z - leaderPos.z) < 1.0f);
|
||||
bool notTooHighFromLeader = createLeader ? true : !(Abs(finalPos.z - leaderPos.z) >= 1.0f);
|
||||
|
||||
if (!foundObstacle && memberCanSeeLeader && notTooCloseToLeader) {
|
||||
if (!foundObstacle && memberCanSeeLeader && notTooHighFromLeader) {
|
||||
CPed* newPed = AddPed(pedType, gangModel, finalPos);
|
||||
if (newPed) {
|
||||
createdPeds[pedIdx++] = newPed;
|
||||
|
@ -1543,6 +1543,9 @@ CPopulation::PlaceGangMembersInCircle(ePedType pedType, int pedAmount, CVector c
|
|||
newPed->bCanAttackPlayerWithCops = true;
|
||||
|
||||
CVisibilityPlugins::SetClumpAlpha(newPed->GetClump(), 0);
|
||||
#ifdef FIX_BUGS
|
||||
createLeader = false;
|
||||
#endif
|
||||
}
|
||||
// No.
|
||||
#ifndef FIX_BUGS
|
||||
|
@ -1551,9 +1554,6 @@ CPopulation::PlaceGangMembersInCircle(ePedType pedType, int pedAmount, CVector c
|
|||
#endif
|
||||
}
|
||||
}
|
||||
#ifdef FIX_BUGS
|
||||
createLeader = false;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
if (pedIdx >= 3) {
|
||||
|
@ -1593,7 +1593,7 @@ CPopulation::PlaceCouple(ePedType manType, int32 manModel, ePedType womanType, i
|
|||
return;
|
||||
|
||||
if (!TheCamera.IsSphereVisible(coors, 1.5f) || MIN_CREATION_DIST * PedCreationDistMultiplier() <= (coors - FindPlayerPed()->GetPosition()).Magnitude2D()) {
|
||||
if (CPedPlacement::IsPositionClearForPed(coors, CModelInfo::GetModelInfo(manModel)->GetColModel()->boundingSphere.radius, -1, 0)) {
|
||||
if (CPedPlacement::IsPositionClearForPed(coors, CModelInfo::GetModelInfo(manModel)->GetColModel()->boundingSphere.radius, -1, nil)) {
|
||||
bool manFoundGround;
|
||||
float manGroundZ = CWorld::FindGroundZFor3DCoord(coors.x, coors.y, coors.z, &manFoundGround) + 1.0f;
|
||||
if (manFoundGround) {
|
||||
|
@ -1675,7 +1675,7 @@ CPopulation::PlaceMallPedsAsStationaryGroup(CVector const& coors, int32 group)
|
|||
if (!TheCamera.IsSphereVisible(coors, circleR) ||
|
||||
MIN_CREATION_DIST * PedCreationDistMultiplier() <= (coors - FindPlayerPed()->GetPosition()).Magnitude2D()) {
|
||||
|
||||
if (CPedPlacement::IsPositionClearForPed(coors, circleR, -1, 0)) {
|
||||
if (CPedPlacement::IsPositionClearForPed(coors, circleR, -1, nil)) {
|
||||
int pedIdx = 0;
|
||||
CVector leaderPos;
|
||||
#ifdef FIX_BUGS
|
||||
|
@ -1700,6 +1700,7 @@ CPopulation::PlaceMallPedsAsStationaryGroup(CVector const& coors, int32 group)
|
|||
|
||||
int pedModel = ChooseCivilianOccupation(group);
|
||||
CPedModelInfo *pedModelInfo = (CPedModelInfo*)CModelInfo::GetModelInfo(pedModel);
|
||||
|
||||
if (pedModelInfo->GetRwObject()) {
|
||||
CEntity* obstacles[6] = { nil, nil, nil, nil, nil, nil };
|
||||
CPedPlacement::IsPositionClearForPed(finalPos, CModelInfo::GetModelInfo(pedModel)->GetColModel()->boundingSphere.radius, ARRAY_SIZE(obstacles), obstacles);
|
||||
|
@ -1721,9 +1722,9 @@ CPopulation::PlaceMallPedsAsStationaryGroup(CVector const& coors, int32 group)
|
|||
}
|
||||
bool memberCanSeeLeader = createLeader ? true : CWorld::GetIsLineOfSightClear(finalPos, leaderPos, true, false, false, false, false, false, false);
|
||||
|
||||
bool notTooCloseToLeader = createLeader ? true : !(Abs(finalPos.z - leaderPos.z) < 1.0f);
|
||||
bool notTooHighFromLeader = createLeader ? true : !(Abs(finalPos.z - leaderPos.z) >= 1.0f);
|
||||
|
||||
if (!foundObstacle && memberCanSeeLeader && notTooCloseToLeader) {
|
||||
if (!foundObstacle && memberCanSeeLeader && notTooHighFromLeader) {
|
||||
CPed *newPed = AddPed(pedModelInfo->m_pedType, pedModel, finalPos);
|
||||
if (newPed) {
|
||||
createdPeds[pedIdx++] = newPed;
|
||||
|
@ -1734,6 +1735,9 @@ CPopulation::PlaceMallPedsAsStationaryGroup(CVector const& coors, int32 group)
|
|||
newPed->m_fRotationCur = angle;
|
||||
newPed->m_fearFlags = 0;
|
||||
CVisibilityPlugins::SetClumpAlpha(newPed->GetClump(), 0);
|
||||
#ifdef FIX_BUGS
|
||||
createLeader = false;
|
||||
#endif
|
||||
}
|
||||
// No.
|
||||
#ifndef FIX_BUGS
|
||||
|
@ -1742,9 +1746,6 @@ CPopulation::PlaceMallPedsAsStationaryGroup(CVector const& coors, int32 group)
|
|||
#endif
|
||||
}
|
||||
}
|
||||
#ifdef FIX_BUGS
|
||||
createLeader = false;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
if (pedIdx >= 3) {
|
||||
|
|
|
@ -28,10 +28,10 @@ RwMemoryFunctions memFuncs = {
|
|||
|
||||
#ifdef USE_CUSTOM_ALLOCATOR
|
||||
// game seems to be using heap directly here, but this is nicer
|
||||
void *operator new(size_t sz) { return MemoryMgrMalloc(sz); }
|
||||
void *operator new[](size_t sz) { return MemoryMgrMalloc(sz); }
|
||||
void operator delete(void *ptr) noexcept { MemoryMgrFree(ptr); }
|
||||
void operator delete[](void *ptr) noexcept { MemoryMgrFree(ptr); }
|
||||
void *operator new(size_t sz) throw() { return MemoryMgrMalloc(sz); }
|
||||
void *operator new[](size_t sz) throw() { return MemoryMgrMalloc(sz); }
|
||||
void operator delete(void *ptr) throw() { MemoryMgrFree(ptr); }
|
||||
void operator delete[](void *ptr) throw() { MemoryMgrFree(ptr); }
|
||||
#endif
|
||||
|
||||
void*
|
||||
|
|
|
@ -50,10 +50,10 @@ bool CVehicle::bDisableRemoteDetonationOnContact;
|
|||
bool CVehicle::m_bDisplayHandlingInfo;
|
||||
#endif
|
||||
|
||||
void *CVehicle::operator new(size_t sz) { return CPools::GetVehiclePool()->New(); }
|
||||
void *CVehicle::operator new(size_t sz, int handle) { return CPools::GetVehiclePool()->New(handle); }
|
||||
void CVehicle::operator delete(void *p, size_t sz) { CPools::GetVehiclePool()->Delete((CVehicle*)p); }
|
||||
void CVehicle::operator delete(void *p, int handle) { CPools::GetVehiclePool()->Delete((CVehicle*)p); }
|
||||
void *CVehicle::operator new(size_t sz) throw() { return CPools::GetVehiclePool()->New(); }
|
||||
void *CVehicle::operator new(size_t sz, int handle) throw() { return CPools::GetVehiclePool()->New(handle); }
|
||||
void CVehicle::operator delete(void *p, size_t sz) throw() { CPools::GetVehiclePool()->Delete((CVehicle*)p); }
|
||||
void CVehicle::operator delete(void *p, int handle) throw() { CPools::GetVehiclePool()->Delete((CVehicle*)p); }
|
||||
|
||||
#ifdef FIX_BUGS
|
||||
// I think they meant that
|
||||
|
|
|
@ -281,10 +281,10 @@ public:
|
|||
float m_fSteerInput;
|
||||
uint8 m_vehType;
|
||||
|
||||
static void *operator new(size_t);
|
||||
static void *operator new(size_t sz, int slot);
|
||||
static void operator delete(void*, size_t);
|
||||
static void operator delete(void*, int);
|
||||
static void *operator new(size_t) throw();
|
||||
static void *operator new(size_t sz, int slot) throw();
|
||||
static void operator delete(void*, size_t) throw();
|
||||
static void operator delete(void*, int) throw();
|
||||
|
||||
CVehicle(void) {} // FAKE
|
||||
CVehicle(uint8 CreatedBy);
|
||||
|
|
Loading…
Reference in a new issue