mirror of
https://git.rip/DMCA_FUCKER/re3.git
synced 2024-12-23 04:20:00 +00:00
Setter for bIsStatic (became virtual in SA)
This commit is contained in:
parent
23220d799c
commit
b91f6a4550
|
@ -165,7 +165,7 @@ CRoadBlocks::GenerateRoadBlocks(void)
|
||||||
vehicleMatrix.GetPosition().z += fModelRadius - 0.6f;
|
vehicleMatrix.GetPosition().z += fModelRadius - 0.6f;
|
||||||
pVehicle->m_matrix = vehicleMatrix;
|
pVehicle->m_matrix = vehicleMatrix;
|
||||||
pVehicle->PlaceOnRoadProperly();
|
pVehicle->PlaceOnRoadProperly();
|
||||||
pVehicle->bIsStatic = false;
|
pVehicle->SetIsStatic(false);
|
||||||
pVehicle->m_matrix.UpdateRW();
|
pVehicle->m_matrix.UpdateRW();
|
||||||
pVehicle->m_nDoorLock = CARLOCK_UNLOCKED;
|
pVehicle->m_nDoorLock = CARLOCK_UNLOCKED;
|
||||||
CCarCtrl::JoinCarWithRoadSystem(pVehicle);
|
CCarCtrl::JoinCarWithRoadSystem(pVehicle);
|
||||||
|
|
|
@ -3577,7 +3577,7 @@ int8 CRunningScript::ProcessCommands100To199(int32 command)
|
||||||
if (pos.z <= MAP_Z_LOW_LIMIT)
|
if (pos.z <= MAP_Z_LOW_LIMIT)
|
||||||
pos.z = CWorld::FindGroundZForCoord(pos.x, pos.y);
|
pos.z = CWorld::FindGroundZForCoord(pos.x, pos.y);
|
||||||
pos.z += car->GetDistanceFromCentreOfMassToBaseOfModel();
|
pos.z += car->GetDistanceFromCentreOfMassToBaseOfModel();
|
||||||
car->bIsStatic = false;
|
car->SetIsStatic(false);
|
||||||
/* Again weird usage of virtual functions. */
|
/* Again weird usage of virtual functions. */
|
||||||
if (car->IsBoat()) {
|
if (car->IsBoat()) {
|
||||||
car->Teleport(pos);
|
car->Teleport(pos);
|
||||||
|
@ -9184,14 +9184,14 @@ int8 CRunningScript::ProcessCommands900To999(int32 command)
|
||||||
CObject* pObject = CPools::GetObjectPool()->GetAt(ScriptParams[0]);
|
CObject* pObject = CPools::GetObjectPool()->GetAt(ScriptParams[0]);
|
||||||
script_assert(pObject);
|
script_assert(pObject);
|
||||||
if (ScriptParams[1]) {
|
if (ScriptParams[1]) {
|
||||||
if (pObject->bIsStatic) {
|
if (pObject->GetIsStatic()) {
|
||||||
pObject->bIsStatic = false;
|
pObject->SetIsStatic(false);
|
||||||
pObject->AddToMovingList();
|
pObject->AddToMovingList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (!pObject->bIsStatic) {
|
if (!pObject->GetIsStatic()) {
|
||||||
pObject->bIsStatic = true;
|
pObject->SetIsStatic(true);
|
||||||
pObject->RemoveFromMovingList();
|
pObject->RemoveFromMovingList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -75,7 +75,7 @@ CWorld::Add(CEntity *ent)
|
||||||
|
|
||||||
if(ent->IsBuilding() || ent->IsDummy()) return;
|
if(ent->IsBuilding() || ent->IsDummy()) return;
|
||||||
|
|
||||||
if(!ent->IsStatic()) ((CPhysical *)ent)->AddToMovingList();
|
if(!ent->GetIsStatic()) ((CPhysical *)ent)->AddToMovingList();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -90,7 +90,7 @@ CWorld::Remove(CEntity *ent)
|
||||||
|
|
||||||
if(ent->IsBuilding() || ent->IsDummy()) return;
|
if(ent->IsBuilding() || ent->IsDummy()) return;
|
||||||
|
|
||||||
if(!ent->IsStatic()) ((CPhysical *)ent)->RemoveFromMovingList();
|
if(!ent->GetIsStatic()) ((CPhysical *)ent)->RemoveFromMovingList();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -1960,7 +1960,7 @@ CWorld::Process(void)
|
||||||
RemoveEntityInsteadOfProcessingIt(movingEnt);
|
RemoveEntityInsteadOfProcessingIt(movingEnt);
|
||||||
} else {
|
} else {
|
||||||
movingEnt->ProcessControl();
|
movingEnt->ProcessControl();
|
||||||
if(movingEnt->IsStatic()) { movingEnt->RemoveFromMovingList(); }
|
if(movingEnt->GetIsStatic()) { movingEnt->RemoveFromMovingList(); }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
bForceProcessControl = true;
|
bForceProcessControl = true;
|
||||||
|
@ -1971,7 +1971,7 @@ CWorld::Process(void)
|
||||||
RemoveEntityInsteadOfProcessingIt(movingEnt);
|
RemoveEntityInsteadOfProcessingIt(movingEnt);
|
||||||
} else {
|
} else {
|
||||||
movingEnt->ProcessControl();
|
movingEnt->ProcessControl();
|
||||||
if(movingEnt->IsStatic()) { movingEnt->RemoveFromMovingList(); }
|
if(movingEnt->GetIsStatic()) { movingEnt->RemoveFromMovingList(); }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2124,13 +2124,13 @@ CWorld::TriggerExplosionSectorList(CPtrList &list, const CVector &position, floa
|
||||||
CObject *pObject = (CObject *)pEntity;
|
CObject *pObject = (CObject *)pEntity;
|
||||||
CVehicle *pVehicle = (CVehicle *)pEntity;
|
CVehicle *pVehicle = (CVehicle *)pEntity;
|
||||||
if(!pEntity->bExplosionProof && (!pEntity->IsPed() || !pPed->bInVehicle)) {
|
if(!pEntity->bExplosionProof && (!pEntity->IsPed() || !pPed->bInVehicle)) {
|
||||||
if(pEntity->IsStatic()) {
|
if(pEntity->GetIsStatic()) {
|
||||||
if(pEntity->IsObject()) {
|
if(pEntity->IsObject()) {
|
||||||
if (fPower > pObject->m_fUprootLimit || IsFence(pObject->GetModelIndex())) {
|
if (fPower > pObject->m_fUprootLimit || IsFence(pObject->GetModelIndex())) {
|
||||||
if (IsGlass(pObject->GetModelIndex())) {
|
if (IsGlass(pObject->GetModelIndex())) {
|
||||||
CGlass::WindowRespondsToExplosion(pObject, position);
|
CGlass::WindowRespondsToExplosion(pObject, position);
|
||||||
} else {
|
} else {
|
||||||
pObject->bIsStatic = false;
|
pObject->SetIsStatic(false);
|
||||||
pObject->AddToMovingList();
|
pObject->AddToMovingList();
|
||||||
int16 modelId = pEntity->GetModelIndex();
|
int16 modelId = pEntity->GetModelIndex();
|
||||||
if(modelId != MI_FIRE_HYDRANT ||
|
if(modelId != MI_FIRE_HYDRANT ||
|
||||||
|
@ -2148,18 +2148,18 @@ CWorld::TriggerExplosionSectorList(CPtrList &list, const CVector &position, floa
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(pEntity->IsStatic()) {
|
if(pEntity->GetIsStatic()) {
|
||||||
float fDamageMultiplier =
|
float fDamageMultiplier =
|
||||||
(fRadius - fMagnitude) * 2.0f / fRadius;
|
(fRadius - fMagnitude) * 2.0f / fRadius;
|
||||||
float fDamage = 300.0f * Min(fDamageMultiplier, 1.0f);
|
float fDamage = 300.0f * Min(fDamageMultiplier, 1.0f);
|
||||||
pObject->ObjectDamage(fDamage);
|
pObject->ObjectDamage(fDamage);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
pEntity->bIsStatic = false;
|
pEntity->SetIsStatic(false);
|
||||||
pEntity->AddToMovingList();
|
pEntity->AddToMovingList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(!pEntity->IsStatic()) {
|
if(!pEntity->GetIsStatic()) {
|
||||||
float fDamageMultiplier = Min((fRadius - fMagnitude) * 2.0f / fRadius, 1.0f);
|
float fDamageMultiplier = Min((fRadius - fMagnitude) * 2.0f / fRadius, 1.0f);
|
||||||
CVector vecForceDir =
|
CVector vecForceDir =
|
||||||
vecDistance * (fPower * pEntity->m_fMass * 0.00071429f * fDamageMultiplier /
|
vecDistance * (fPower * pEntity->m_fMass * 0.00071429f * fDamageMultiplier /
|
||||||
|
|
|
@ -97,7 +97,8 @@ public:
|
||||||
eEntityStatus GetStatus() const { return (eEntityStatus)m_status; }
|
eEntityStatus GetStatus() const { return (eEntityStatus)m_status; }
|
||||||
void SetStatus(eEntityStatus status) { m_status = status; }
|
void SetStatus(eEntityStatus status) { m_status = status; }
|
||||||
CColModel *GetColModel(void) { return CModelInfo::GetModelInfo(m_modelIndex)->GetColModel(); }
|
CColModel *GetColModel(void) { return CModelInfo::GetModelInfo(m_modelIndex)->GetColModel(); }
|
||||||
bool IsStatic(void) { return bIsStatic; }
|
bool GetIsStatic(void) const { return bIsStatic; }
|
||||||
|
void SetIsStatic(bool state) { bIsStatic = state; }
|
||||||
#ifdef COMPATIBLE_SAVES
|
#ifdef COMPATIBLE_SAVES
|
||||||
void SaveEntityFlags(uint8*& buf);
|
void SaveEntityFlags(uint8*& buf);
|
||||||
void LoadEntityFlags(uint8*& buf);
|
void LoadEntityFlags(uint8*& buf);
|
||||||
|
|
|
@ -341,7 +341,7 @@ CPhysical::ProcessEntityCollision(CEntity *ent, CColPoint *colpoints)
|
||||||
AddCollisionRecord(ent);
|
AddCollisionRecord(ent);
|
||||||
if(!ent->IsBuilding()) // Can't this catch dummies too?
|
if(!ent->IsBuilding()) // Can't this catch dummies too?
|
||||||
((CPhysical*)ent)->AddCollisionRecord(this);
|
((CPhysical*)ent)->AddCollisionRecord(this);
|
||||||
if(ent->IsBuilding() || ent->IsStatic())
|
if(ent->IsBuilding() || ent->GetIsStatic())
|
||||||
this->bHasHitWall = true;
|
this->bHasHitWall = true;
|
||||||
}
|
}
|
||||||
return numSpheres;
|
return numSpheres;
|
||||||
|
@ -377,7 +377,7 @@ CPhysical::ProcessControl(void)
|
||||||
m_nStaticFrames++;
|
m_nStaticFrames++;
|
||||||
if(m_nStaticFrames > 10){
|
if(m_nStaticFrames > 10){
|
||||||
m_nStaticFrames = 10;
|
m_nStaticFrames = 10;
|
||||||
bIsStatic = true;
|
SetIsStatic(true);
|
||||||
m_vecMoveSpeed = CVector(0.0f, 0.0f, 0.0f);
|
m_vecMoveSpeed = CVector(0.0f, 0.0f, 0.0f);
|
||||||
m_vecTurnSpeed = CVector(0.0f, 0.0f, 0.0f);
|
m_vecTurnSpeed = CVector(0.0f, 0.0f, 0.0f);
|
||||||
m_vecMoveFriction = m_vecMoveSpeed;
|
m_vecMoveFriction = m_vecMoveSpeed;
|
||||||
|
@ -556,7 +556,7 @@ CPhysical::ApplyCollision(CPhysical *B, CColPoint &colpoint, float &impulseA, fl
|
||||||
massFactorB = B->bIsHeavy ? 2.0f : 1.0f;
|
massFactorB = B->bIsHeavy ? 2.0f : 1.0f;
|
||||||
|
|
||||||
float speedA, speedB;
|
float speedA, speedB;
|
||||||
if(B->IsStatic()){
|
if(B->GetIsStatic()){
|
||||||
if(A->bPedPhysics){
|
if(A->bPedPhysics){
|
||||||
speedA = DotProduct(A->m_vecMoveSpeed, colpoint.normal);
|
speedA = DotProduct(A->m_vecMoveSpeed, colpoint.normal);
|
||||||
if(speedA < 0.0f){
|
if(speedA < 0.0f){
|
||||||
|
@ -567,7 +567,7 @@ CPhysical::ApplyCollision(CPhysical *B, CColPoint &colpoint, float &impulseA, fl
|
||||||
if(IsGlass(B->GetModelIndex()))
|
if(IsGlass(B->GetModelIndex()))
|
||||||
CGlass::WindowRespondsToCollision(B, impulseA, A->m_vecMoveSpeed, colpoint.point, false);
|
CGlass::WindowRespondsToCollision(B, impulseA, A->m_vecMoveSpeed, colpoint.point, false);
|
||||||
else if(!B->bInfiniteMass)
|
else if(!B->bInfiniteMass)
|
||||||
B->bIsStatic = false;
|
B->SetIsStatic(false);
|
||||||
}else{
|
}else{
|
||||||
if(IsGlass(B->GetModelIndex()))
|
if(IsGlass(B->GetModelIndex()))
|
||||||
CGlass::WindowRespondsToSoftCollision(B, impulseA);
|
CGlass::WindowRespondsToSoftCollision(B, impulseA);
|
||||||
|
@ -576,7 +576,7 @@ CPhysical::ApplyCollision(CPhysical *B, CColPoint &colpoint, float &impulseA, fl
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}else if(!B->bInfiniteMass)
|
}else if(!B->bInfiniteMass)
|
||||||
B->bIsStatic = false;
|
B->SetIsStatic(false);
|
||||||
|
|
||||||
if(B->bInfiniteMass){
|
if(B->bInfiniteMass){
|
||||||
impulseA = -speedA * A->m_fMass;
|
impulseA = -speedA * A->m_fMass;
|
||||||
|
@ -614,7 +614,7 @@ CPhysical::ApplyCollision(CPhysical *B, CColPoint &colpoint, float &impulseA, fl
|
||||||
if(IsGlass(B->GetModelIndex()))
|
if(IsGlass(B->GetModelIndex()))
|
||||||
CGlass::WindowRespondsToCollision(B, impulseA, A->m_vecMoveSpeed, colpoint.point, false);
|
CGlass::WindowRespondsToCollision(B, impulseA, A->m_vecMoveSpeed, colpoint.point, false);
|
||||||
else
|
else
|
||||||
B->bIsStatic = false;
|
B->SetIsStatic(false);
|
||||||
int16 model = B->GetModelIndex();
|
int16 model = B->GetModelIndex();
|
||||||
if(model == MI_FIRE_HYDRANT && !Bobj->bHasBeenDamaged){
|
if(model == MI_FIRE_HYDRANT && !Bobj->bHasBeenDamaged){
|
||||||
CParticleObject::AddObject(POBJECT_FIRE_HYDRANT, B->GetPosition() - CVector(0.0f, 0.0f, 0.5f), true);
|
CParticleObject::AddObject(POBJECT_FIRE_HYDRANT, B->GetPosition() - CVector(0.0f, 0.0f, 0.5f), true);
|
||||||
|
@ -635,11 +635,11 @@ CPhysical::ApplyCollision(CPhysical *B, CColPoint &colpoint, float &impulseA, fl
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}else if(!B->bInfiniteMass)
|
}else if(!B->bInfiniteMass)
|
||||||
B->bIsStatic = false;
|
B->SetIsStatic(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(B->IsStatic())
|
if(B->GetIsStatic())
|
||||||
return false;
|
return false;
|
||||||
if(!B->bInfiniteMass)
|
if(!B->bInfiniteMass)
|
||||||
B->AddToMovingList();
|
B->AddToMovingList();
|
||||||
|
@ -1074,7 +1074,7 @@ CPhysical::ProcessShiftSectorList(CPtrList *lists)
|
||||||
canshift = true;
|
canshift = true;
|
||||||
else
|
else
|
||||||
canshift = A->IsPed() &&
|
canshift = A->IsPed() &&
|
||||||
B->IsObject() && B->bIsStatic && !Bobj->bHasBeenDamaged;
|
B->IsObject() && B->GetIsStatic() && !Bobj->bHasBeenDamaged;
|
||||||
if(B == A ||
|
if(B == A ||
|
||||||
B->m_scanCode == CWorld::GetCurrentScanCode() ||
|
B->m_scanCode == CWorld::GetCurrentScanCode() ||
|
||||||
!B->bUsesCollision ||
|
!B->bUsesCollision ||
|
||||||
|
@ -1098,7 +1098,7 @@ CPhysical::ProcessShiftSectorList(CPtrList *lists)
|
||||||
CObject *Aobj = (CObject*)A;
|
CObject *Aobj = (CObject*)A;
|
||||||
if(Aobj->ObjectCreatedBy != TEMP_OBJECT &&
|
if(Aobj->ObjectCreatedBy != TEMP_OBJECT &&
|
||||||
!Aobj->bHasBeenDamaged &&
|
!Aobj->bHasBeenDamaged &&
|
||||||
Aobj->IsStatic()){
|
Aobj->GetIsStatic()){
|
||||||
if(Aobj->m_pCollidingEntity == B)
|
if(Aobj->m_pCollidingEntity == B)
|
||||||
Aobj->m_pCollidingEntity = nil;
|
Aobj->m_pCollidingEntity = nil;
|
||||||
}else if(Aobj->m_pCollidingEntity != B){
|
}else if(Aobj->m_pCollidingEntity != B){
|
||||||
|
@ -1115,7 +1115,7 @@ CPhysical::ProcessShiftSectorList(CPtrList *lists)
|
||||||
CObject *Bobj = (CObject*)B;
|
CObject *Bobj = (CObject*)B;
|
||||||
if(Bobj->ObjectCreatedBy != TEMP_OBJECT &&
|
if(Bobj->ObjectCreatedBy != TEMP_OBJECT &&
|
||||||
!Bobj->bHasBeenDamaged &&
|
!Bobj->bHasBeenDamaged &&
|
||||||
Bobj->IsStatic()){
|
Bobj->GetIsStatic()){
|
||||||
if(Bobj->m_pCollidingEntity == A)
|
if(Bobj->m_pCollidingEntity == A)
|
||||||
Bobj->m_pCollidingEntity = nil;
|
Bobj->m_pCollidingEntity = nil;
|
||||||
}else if(Bobj->m_pCollidingEntity != A){
|
}else if(Bobj->m_pCollidingEntity != A){
|
||||||
|
@ -1433,7 +1433,7 @@ CPhysical::ProcessCollisionSectorList(CPtrList *lists)
|
||||||
skipCollision = true;
|
skipCollision = true;
|
||||||
else if(Aobj->ObjectCreatedBy == TEMP_OBJECT ||
|
else if(Aobj->ObjectCreatedBy == TEMP_OBJECT ||
|
||||||
Aobj->bHasBeenDamaged ||
|
Aobj->bHasBeenDamaged ||
|
||||||
!Aobj->IsStatic()){
|
!Aobj->GetIsStatic()){
|
||||||
if(Aobj->m_pCollidingEntity == B)
|
if(Aobj->m_pCollidingEntity == B)
|
||||||
skipCollision = true;
|
skipCollision = true;
|
||||||
else{
|
else{
|
||||||
|
@ -1452,7 +1452,7 @@ CPhysical::ProcessCollisionSectorList(CPtrList *lists)
|
||||||
skipCollision = true;
|
skipCollision = true;
|
||||||
else if(Bobj->ObjectCreatedBy == TEMP_OBJECT ||
|
else if(Bobj->ObjectCreatedBy == TEMP_OBJECT ||
|
||||||
Bobj->bHasBeenDamaged ||
|
Bobj->bHasBeenDamaged ||
|
||||||
!Bobj->IsStatic()){
|
!Bobj->GetIsStatic()){
|
||||||
if(Bobj->m_pCollidingEntity == A)
|
if(Bobj->m_pCollidingEntity == A)
|
||||||
skipCollision = true;
|
skipCollision = true;
|
||||||
else{
|
else{
|
||||||
|
|
|
@ -91,7 +91,7 @@ CObject::ProcessControl(void)
|
||||||
CPhysical::ProcessControl();
|
CPhysical::ProcessControl();
|
||||||
if (mod_Buoyancy.ProcessBuoyancy(this, m_fBuoyancy, &point, &impulse)) {
|
if (mod_Buoyancy.ProcessBuoyancy(this, m_fBuoyancy, &point, &impulse)) {
|
||||||
bIsInWater = true;
|
bIsInWater = true;
|
||||||
bIsStatic = false;
|
SetIsStatic(false);
|
||||||
ApplyMoveForce(impulse);
|
ApplyMoveForce(impulse);
|
||||||
ApplyTurnForce(impulse, point);
|
ApplyTurnForce(impulse, point);
|
||||||
float fTimeStep = Pow(0.97f, CTimer::GetTimeStep());
|
float fTimeStep = Pow(0.97f, CTimer::GetTimeStep());
|
||||||
|
@ -182,7 +182,7 @@ CObject::ObjectDamage(float amount)
|
||||||
case DAMAGE_EFFECT_SMASH_COMPLETELY:
|
case DAMAGE_EFFECT_SMASH_COMPLETELY:
|
||||||
bIsVisible = false;
|
bIsVisible = false;
|
||||||
bUsesCollision = false;
|
bUsesCollision = false;
|
||||||
bIsStatic = true;
|
SetIsStatic(true);
|
||||||
bExplosionProof = true;
|
bExplosionProof = true;
|
||||||
SetMoveSpeed(0.0f, 0.0f, 0.0f);
|
SetMoveSpeed(0.0f, 0.0f, 0.0f);
|
||||||
SetTurnSpeed(0.0f, 0.0f, 0.0f);
|
SetTurnSpeed(0.0f, 0.0f, 0.0f);
|
||||||
|
@ -194,7 +194,7 @@ CObject::ObjectDamage(float amount)
|
||||||
else {
|
else {
|
||||||
bIsVisible = false;
|
bIsVisible = false;
|
||||||
bUsesCollision = false;
|
bUsesCollision = false;
|
||||||
bIsStatic = true;
|
SetIsStatic(true);
|
||||||
bExplosionProof = true;
|
bExplosionProof = true;
|
||||||
SetMoveSpeed(0.0f, 0.0f, 0.0f);
|
SetMoveSpeed(0.0f, 0.0f, 0.0f);
|
||||||
SetTurnSpeed(0.0f, 0.0f, 0.0f);
|
SetTurnSpeed(0.0f, 0.0f, 0.0f);
|
||||||
|
@ -203,7 +203,7 @@ CObject::ObjectDamage(float amount)
|
||||||
case DAMAGE_EFFECT_SMASH_CARDBOARD_COMPLETELY: {
|
case DAMAGE_EFFECT_SMASH_CARDBOARD_COMPLETELY: {
|
||||||
bIsVisible = false;
|
bIsVisible = false;
|
||||||
bUsesCollision = false;
|
bUsesCollision = false;
|
||||||
bIsStatic = true;
|
SetIsStatic(true);
|
||||||
bExplosionProof = true;
|
bExplosionProof = true;
|
||||||
SetMoveSpeed(0.0f, 0.0f, 0.0f);
|
SetMoveSpeed(0.0f, 0.0f, 0.0f);
|
||||||
SetTurnSpeed(0.0f, 0.0f, 0.0f);
|
SetTurnSpeed(0.0f, 0.0f, 0.0f);
|
||||||
|
@ -226,7 +226,7 @@ CObject::ObjectDamage(float amount)
|
||||||
case DAMAGE_EFFECT_SMASH_WOODENBOX_COMPLETELY: {
|
case DAMAGE_EFFECT_SMASH_WOODENBOX_COMPLETELY: {
|
||||||
bIsVisible = false;
|
bIsVisible = false;
|
||||||
bUsesCollision = false;
|
bUsesCollision = false;
|
||||||
bIsStatic = true;
|
SetIsStatic(true);
|
||||||
bExplosionProof = true;
|
bExplosionProof = true;
|
||||||
SetMoveSpeed(0.0f, 0.0f, 0.0f);
|
SetMoveSpeed(0.0f, 0.0f, 0.0f);
|
||||||
SetTurnSpeed(0.0f, 0.0f, 0.0f);
|
SetTurnSpeed(0.0f, 0.0f, 0.0f);
|
||||||
|
@ -249,7 +249,7 @@ CObject::ObjectDamage(float amount)
|
||||||
case DAMAGE_EFFECT_SMASH_TRAFFICCONE_COMPLETELY: {
|
case DAMAGE_EFFECT_SMASH_TRAFFICCONE_COMPLETELY: {
|
||||||
bIsVisible = false;
|
bIsVisible = false;
|
||||||
bUsesCollision = false;
|
bUsesCollision = false;
|
||||||
bIsStatic = true;
|
SetIsStatic(true);
|
||||||
bExplosionProof = true;
|
bExplosionProof = true;
|
||||||
SetMoveSpeed(0.0f, 0.0f, 0.0f);
|
SetMoveSpeed(0.0f, 0.0f, 0.0f);
|
||||||
SetTurnSpeed(0.0f, 0.0f, 0.0f);
|
SetTurnSpeed(0.0f, 0.0f, 0.0f);
|
||||||
|
@ -274,7 +274,7 @@ CObject::ObjectDamage(float amount)
|
||||||
case DAMAGE_EFFECT_SMASH_BARPOST_COMPLETELY: {
|
case DAMAGE_EFFECT_SMASH_BARPOST_COMPLETELY: {
|
||||||
bIsVisible = false;
|
bIsVisible = false;
|
||||||
bUsesCollision = false;
|
bUsesCollision = false;
|
||||||
bIsStatic = true;
|
SetIsStatic(true);
|
||||||
bExplosionProof = true;
|
bExplosionProof = true;
|
||||||
SetMoveSpeed(0.0f, 0.0f, 0.0f);
|
SetMoveSpeed(0.0f, 0.0f, 0.0f);
|
||||||
SetTurnSpeed(0.0f, 0.0f, 0.0f);
|
SetTurnSpeed(0.0f, 0.0f, 0.0f);
|
||||||
|
@ -314,7 +314,7 @@ CObject::Init(void)
|
||||||
CObjectData::SetObjectData(GetModelIndex(), *this);
|
CObjectData::SetObjectData(GetModelIndex(), *this);
|
||||||
m_nEndOfLifeTime = 0;
|
m_nEndOfLifeTime = 0;
|
||||||
ObjectCreatedBy = GAME_OBJECT;
|
ObjectCreatedBy = GAME_OBJECT;
|
||||||
bIsStatic = true;
|
SetIsStatic(true);
|
||||||
bIsPickup = false;
|
bIsPickup = false;
|
||||||
bPickupObjWithMessage = false;
|
bPickupObjWithMessage = false;
|
||||||
bOutOfStock = false;
|
bOutOfStock = false;
|
||||||
|
|
|
@ -14606,11 +14606,11 @@ CPed::ProcessEntityCollision(CEntity *collidingEnt, CColPoint *collidingPoints)
|
||||||
if (!collidingEnt->IsBuilding())
|
if (!collidingEnt->IsBuilding())
|
||||||
((CPhysical*)collidingEnt)->AddCollisionRecord(this);
|
((CPhysical*)collidingEnt)->AddCollisionRecord(this);
|
||||||
|
|
||||||
if (ourCollidedSpheres > 0 && (collidingEnt->IsBuilding() || collidingEnt->IsStatic())) {
|
if (ourCollidedSpheres > 0 && (collidingEnt->IsBuilding() || collidingEnt->GetIsStatic())) {
|
||||||
bHasHitWall = true;
|
bHasHitWall = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (collidingEnt->IsBuilding() || collidingEnt->IsStatic()) {
|
if (collidingEnt->IsBuilding() || collidingEnt->GetIsStatic()) {
|
||||||
|
|
||||||
if (bWasStanding) {
|
if (bWasStanding) {
|
||||||
CVector sphereNormal;
|
CVector sphereNormal;
|
||||||
|
@ -15956,7 +15956,7 @@ CPed::SeekCar(void)
|
||||||
} else {
|
} else {
|
||||||
m_fRotationCur = m_fRotationDest;
|
m_fRotationCur = m_fRotationDest;
|
||||||
if (!bVehEnterDoorIsBlocked) {
|
if (!bVehEnterDoorIsBlocked) {
|
||||||
vehToSeek->bIsStatic = false;
|
vehToSeek->SetIsStatic(false);
|
||||||
if (m_objective == OBJECTIVE_SOLICIT_VEHICLE) {
|
if (m_objective == OBJECTIVE_SOLICIT_VEHICLE) {
|
||||||
SetSolicit(1000);
|
SetSolicit(1000);
|
||||||
} else if (m_objective == OBJECTIVE_BUY_ICE_CREAM) {
|
} else if (m_objective == OBJECTIVE_BUY_ICE_CREAM) {
|
||||||
|
@ -16637,7 +16637,7 @@ CPed::SpawnFlyingComponent(int pedNode, int8 direction)
|
||||||
obj->m_fElasticity = 0.03f;
|
obj->m_fElasticity = 0.03f;
|
||||||
obj->m_fBuoyancy = m_fMass*GRAVITY/0.75f;
|
obj->m_fBuoyancy = m_fMass*GRAVITY/0.75f;
|
||||||
obj->ObjectCreatedBy = TEMP_OBJECT;
|
obj->ObjectCreatedBy = TEMP_OBJECT;
|
||||||
obj->bIsStatic = false;
|
obj->SetIsStatic(false);
|
||||||
obj->bIsPickup = false;
|
obj->bIsPickup = false;
|
||||||
obj->m_nSpecialCollisionResponseCases = COLLRESPONSE_SMALLBOX;
|
obj->m_nSpecialCollisionResponseCases = COLLRESPONSE_SMALLBOX;
|
||||||
|
|
||||||
|
|
|
@ -972,7 +972,7 @@ CPopulation::ConvertToRealObject(CDummyObject *dummy)
|
||||||
if (IsGlass(obj->GetModelIndex())) {
|
if (IsGlass(obj->GetModelIndex())) {
|
||||||
obj->bIsVisible = false;
|
obj->bIsVisible = false;
|
||||||
} else if (obj->GetModelIndex() == MI_BUOY) {
|
} else if (obj->GetModelIndex() == MI_BUOY) {
|
||||||
obj->bIsStatic = false;
|
obj->SetIsStatic(false);
|
||||||
obj->m_vecMoveSpeed = CVector(0.0f, 0.0f, -0.001f);
|
obj->m_vecMoveSpeed = CVector(0.0f, 0.0f, -0.001f);
|
||||||
obj->bTouchingWater = true;
|
obj->bTouchingWater = true;
|
||||||
obj->AddToMovingList();
|
obj->AddToMovingList();
|
||||||
|
|
|
@ -1208,7 +1208,7 @@ CRenderer::IsEntityCullZoneVisible(CEntity *ent)
|
||||||
return !(ped->m_pCurSurface && ped->m_pCurSurface->bZoneCulled2);
|
return !(ped->m_pCurSurface && ped->m_pCurSurface->bZoneCulled2);
|
||||||
case ENTITY_TYPE_OBJECT:
|
case ENTITY_TYPE_OBJECT:
|
||||||
obj = (CObject*)ent;
|
obj = (CObject*)ent;
|
||||||
if(!obj->IsStatic())
|
if(!obj->GetIsStatic())
|
||||||
return true;
|
return true;
|
||||||
return !(obj->m_pCurSurface && obj->m_pCurSurface->bZoneCulled2);
|
return !(obj->m_pCurSurface && obj->m_pCurSurface->bZoneCulled2);
|
||||||
default: break;
|
default: break;
|
||||||
|
|
|
@ -2192,8 +2192,8 @@ CAutomobile::ProcessEntityCollision(CEntity *ent, CColPoint *colpoints)
|
||||||
}
|
}
|
||||||
|
|
||||||
// move body cast
|
// move body cast
|
||||||
if(phys->IsStatic()){
|
if(phys->GetIsStatic()){
|
||||||
phys->bIsStatic = false;
|
phys->SetIsStatic(false);
|
||||||
phys->m_nStaticFrames = 0;
|
phys->m_nStaticFrames = 0;
|
||||||
phys->ApplyMoveForce(m_vecMoveSpeed / Sqrt(speed));
|
phys->ApplyMoveForce(m_vecMoveSpeed / Sqrt(speed));
|
||||||
phys->AddToMovingList();
|
phys->AddToMovingList();
|
||||||
|
@ -4385,7 +4385,7 @@ CAutomobile::SpawnFlyingComponent(int32 component, uint32 type)
|
||||||
obj->m_fElasticity = 0.1f;
|
obj->m_fElasticity = 0.1f;
|
||||||
obj->m_fBuoyancy = obj->m_fMass*GRAVITY/0.75f;
|
obj->m_fBuoyancy = obj->m_fMass*GRAVITY/0.75f;
|
||||||
obj->ObjectCreatedBy = TEMP_OBJECT;
|
obj->ObjectCreatedBy = TEMP_OBJECT;
|
||||||
obj->bIsStatic = false;
|
obj->SetIsStatic(false);
|
||||||
obj->bIsPickup = false;
|
obj->bIsPickup = false;
|
||||||
obj->bUseVehicleColours = true;
|
obj->bUseVehicleColours = true;
|
||||||
obj->m_colour1 = m_currentColour1;
|
obj->m_colour1 = m_currentColour1;
|
||||||
|
|
|
@ -664,7 +664,7 @@ CBoat::BlowUpCar(CEntity *culprit)
|
||||||
obj->m_fElasticity = 0.1f;
|
obj->m_fElasticity = 0.1f;
|
||||||
obj->m_fBuoyancy = obj->m_fMass*GRAVITY/0.75f;
|
obj->m_fBuoyancy = obj->m_fMass*GRAVITY/0.75f;
|
||||||
obj->ObjectCreatedBy = TEMP_OBJECT;
|
obj->ObjectCreatedBy = TEMP_OBJECT;
|
||||||
obj->bIsStatic = false;
|
obj->SetIsStatic(false);
|
||||||
obj->bIsPickup = false;
|
obj->bIsPickup = false;
|
||||||
|
|
||||||
// life time
|
// life time
|
||||||
|
|
|
@ -58,7 +58,7 @@ void CCarGenerator::DoInternalProcessing()
|
||||||
return;
|
return;
|
||||||
if (CModelInfo::IsBoatModel(m_nModelIndex)){
|
if (CModelInfo::IsBoatModel(m_nModelIndex)){
|
||||||
CBoat* pBoat = new CBoat(m_nModelIndex, PARKED_VEHICLE);
|
CBoat* pBoat = new CBoat(m_nModelIndex, PARKED_VEHICLE);
|
||||||
pBoat->bIsStatic = false;
|
pBoat->SetIsStatic(false);
|
||||||
pBoat->bEngineOn = false;
|
pBoat->bEngineOn = false;
|
||||||
CVector pos = m_vecPos;
|
CVector pos = m_vecPos;
|
||||||
if (pos.z <= -100.0f)
|
if (pos.z <= -100.0f)
|
||||||
|
@ -101,7 +101,7 @@ void CCarGenerator::DoInternalProcessing()
|
||||||
if (((CVehicleModelInfo*)CModelInfo::GetModelInfo(m_nModelIndex))->m_vehicleType != VEHICLE_TYPE_BIKE)
|
if (((CVehicleModelInfo*)CModelInfo::GetModelInfo(m_nModelIndex))->m_vehicleType != VEHICLE_TYPE_BIKE)
|
||||||
pCar = new CAutomobile(m_nModelIndex, PARKED_VEHICLE);
|
pCar = new CAutomobile(m_nModelIndex, PARKED_VEHICLE);
|
||||||
|
|
||||||
pCar->bIsStatic = false;
|
pCar->SetIsStatic(false);
|
||||||
pCar->bEngineOn = false;
|
pCar->bEngineOn = false;
|
||||||
pos.z += pCar->GetDistanceFromCentreOfMassToBaseOfModel();
|
pos.z += pCar->GetDistanceFromCentreOfMassToBaseOfModel();
|
||||||
pCar->SetPosition(pos);
|
pCar->SetPosition(pos);
|
||||||
|
|
|
@ -726,7 +726,7 @@ CHeli::SpawnFlyingComponent(int32 component)
|
||||||
obj->m_fElasticity = 0.1f;
|
obj->m_fElasticity = 0.1f;
|
||||||
obj->m_fBuoyancy = obj->m_fMass*GRAVITY/0.75f;
|
obj->m_fBuoyancy = obj->m_fMass*GRAVITY/0.75f;
|
||||||
obj->ObjectCreatedBy = TEMP_OBJECT;
|
obj->ObjectCreatedBy = TEMP_OBJECT;
|
||||||
obj->bIsStatic = false;
|
obj->SetIsStatic(false);
|
||||||
obj->bIsPickup = false;
|
obj->bIsPickup = false;
|
||||||
|
|
||||||
// life time
|
// life time
|
||||||
|
|
|
@ -185,11 +185,11 @@ void CBulletInfo::Update(void)
|
||||||
if (pHitEntity->IsObject()) {
|
if (pHitEntity->IsObject()) {
|
||||||
CObject* pObject = (CObject*)pHitEntity;
|
CObject* pObject = (CObject*)pHitEntity;
|
||||||
if (!pObject->bInfiniteMass) {
|
if (!pObject->bInfiniteMass) {
|
||||||
if (pObject->IsStatic() && pObject->m_fUprootLimit <= 0.0f) {
|
if (pObject->GetIsStatic() && pObject->m_fUprootLimit <= 0.0f) {
|
||||||
pObject->bIsStatic = false;
|
pObject->SetIsStatic(false);
|
||||||
pObject->AddToMovingList();
|
pObject->AddToMovingList();
|
||||||
}
|
}
|
||||||
if (!pObject->IsStatic())
|
if (!pObject->GetIsStatic())
|
||||||
pObject->ApplyMoveForce(-BULLET_HIT_FORCE * point.normal);
|
pObject->ApplyMoveForce(-BULLET_HIT_FORCE * point.normal);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1057,13 +1057,13 @@ CWeapon::DoBulletImpact(CEntity *shooter, CEntity *victim,
|
||||||
|
|
||||||
if ( !victimObject->bInfiniteMass )
|
if ( !victimObject->bInfiniteMass )
|
||||||
{
|
{
|
||||||
if ( victimObject->IsStatic() && victimObject->m_fUprootLimit <= 0.0f )
|
if ( victimObject->GetIsStatic() && victimObject->m_fUprootLimit <= 0.0f )
|
||||||
{
|
{
|
||||||
victimObject->bIsStatic = false;
|
victimObject->SetIsStatic(false);
|
||||||
victimObject->AddToMovingList();
|
victimObject->AddToMovingList();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( !victimObject->IsStatic())
|
if ( !victimObject->GetIsStatic())
|
||||||
{
|
{
|
||||||
CVector moveForce = point->normal*-4.0f;
|
CVector moveForce = point->normal*-4.0f;
|
||||||
victimObject->ApplyMoveForce(moveForce.x, moveForce.y, moveForce.z);
|
victimObject->ApplyMoveForce(moveForce.x, moveForce.y, moveForce.z);
|
||||||
|
@ -1316,13 +1316,13 @@ CWeapon::FireShotgun(CEntity *shooter, CVector *fireSource)
|
||||||
|
|
||||||
if ( !victimObject->bInfiniteMass )
|
if ( !victimObject->bInfiniteMass )
|
||||||
{
|
{
|
||||||
if ( victimObject->IsStatic() && victimObject->m_fUprootLimit <= 0.0f )
|
if ( victimObject->GetIsStatic() && victimObject->m_fUprootLimit <= 0.0f )
|
||||||
{
|
{
|
||||||
victimObject->bIsStatic = false;
|
victimObject->SetIsStatic(false);
|
||||||
victimObject->AddToMovingList();
|
victimObject->AddToMovingList();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( !victimObject->IsStatic())
|
if ( !victimObject->GetIsStatic())
|
||||||
{
|
{
|
||||||
CVector moveForce = point.normal*-5.0f;
|
CVector moveForce = point.normal*-5.0f;
|
||||||
victimObject->ApplyMoveForce(moveForce.x, moveForce.y, moveForce.z);
|
victimObject->ApplyMoveForce(moveForce.x, moveForce.y, moveForce.z);
|
||||||
|
@ -2258,9 +2258,9 @@ CWeapon::BlowUpExplosiveThings(CEntity *thing)
|
||||||
object->m_vecMoveSpeed.x += float((CGeneral::GetRandomNumber()&255) - 128) * 0.0002f;
|
object->m_vecMoveSpeed.x += float((CGeneral::GetRandomNumber()&255) - 128) * 0.0002f;
|
||||||
object->m_vecMoveSpeed.y += float((CGeneral::GetRandomNumber()&255) - 128) * 0.0002f;
|
object->m_vecMoveSpeed.y += float((CGeneral::GetRandomNumber()&255) - 128) * 0.0002f;
|
||||||
|
|
||||||
if ( object->IsStatic())
|
if ( object->GetIsStatic())
|
||||||
{
|
{
|
||||||
object->bIsStatic = false;
|
object->SetIsStatic(false);
|
||||||
object->AddToMovingList();
|
object->AddToMovingList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue