Plane crashfix and more

This commit is contained in:
Sergeanur 2020-01-23 17:29:36 +02:00
parent 77515f04e0
commit 9eb599ff58
6 changed files with 10 additions and 12 deletions

View File

@ -656,7 +656,7 @@ CFileLoader::LoadMLO(const char *line)
CMloModelInfo *minfo = CModelInfo::AddMloModel(modelIndex); CMloModelInfo *minfo = CModelInfo::AddMloModel(modelIndex);
minfo->SetName(name); minfo->SetName(name);
minfo->field_34 = someFloat; minfo->field_34 = someFloat;
int instId = CModelInfo::GetMloInstanceStore()->allocPtr; int instId = CModelInfo::GetMloInstanceStore().allocPtr;
minfo->firstInstance = instId; minfo->firstInstance = instId;
minfo->lastInstance = instId; minfo->lastInstance = instId;
minfo->SetTexDictionary("generic"); minfo->SetTexDictionary("generic");
@ -680,7 +680,7 @@ CFileLoader::LoadMLOInstance(int id, const char *line)
&rot.x, &rot.y, &rot.z, &rot.x, &rot.y, &rot.z,
&angle); &angle);
float rad = 2.0f * (PI / 2.0f - Atan2(angle, Sqrt(1.0f - SQR(angle)))); float rad = 2.0f * (PI / 2.0f - Atan2(angle, Sqrt(1.0f - SQR(angle))));
CInstance *inst = CModelInfo::GetMloInstanceStore()->alloc(); CInstance *inst = CModelInfo::GetMloInstanceStore().alloc();
minfo->lastInstance++; minfo->lastInstance++;
RwMatrix *matrix = RwMatrixCreate(); RwMatrix *matrix = RwMatrixCreate();

View File

@ -6,9 +6,7 @@ class CSolid : public CEntity
{ {
public: public:
CSolid(void) { CSolid(void) {
bRemoveFromWorld = true; m_type = ENTITY_TYPE_BUILDING;
bHasHitWall = false; bUsesCollision = true;
bImBeingRendered = false;
m_flagE2 = true;
} }
}; };

View File

@ -12,8 +12,8 @@ CMloModelInfo::ConstructClump()
RpClumpSetFrame(m_clump, mainFrame); RpClumpSetFrame(m_clump, mainFrame);
for (int i = firstInstance; i < lastInstance; i++) { for (int i = firstInstance; i < lastInstance; i++) {
int modelId = CModelInfo::GetMloInstanceStore()->store[i].m_modelIndex; int modelId = CModelInfo::GetMloInstanceStore().store[i].m_modelIndex;
RwMatrix *attMat = CModelInfo::GetMloInstanceStore()->store[i].GetMatrix().m_attachment; RwMatrix *attMat = CModelInfo::GetMloInstanceStore().store[i].GetMatrix().m_attachment;
CSimpleModelInfo *minfo = (CSimpleModelInfo*)CModelInfo::GetModelInfo(modelId); CSimpleModelInfo *minfo = (CSimpleModelInfo*)CModelInfo::GetModelInfo(modelId);
if (minfo->m_atomics[0] != nil) { if (minfo->m_atomics[0] != nil) {

View File

@ -218,10 +218,10 @@ CModelInfo::RemoveColModelsFromOtherLevels(eLevelName level)
} }
} }
CStore<CInstance, MLOINSTANCESIZE>* CStore<CInstance, MLOINSTANCESIZE>&
CModelInfo::GetMloInstanceStore() CModelInfo::GetMloInstanceStore()
{ {
return &CModelInfo::ms_mloInstanceStore; return CModelInfo::ms_mloInstanceStore;
} }
void void

View File

@ -36,6 +36,7 @@ public:
static CVehicleModelInfo *AddVehicleModel(int id); static CVehicleModelInfo *AddVehicleModel(int id);
static CStore<C2dEffect, TWODFXSIZE> &Get2dEffectStore(void) { return ms_2dEffectStore; } static CStore<C2dEffect, TWODFXSIZE> &Get2dEffectStore(void) { return ms_2dEffectStore; }
static CStore<CInstance, MLOINSTANCESIZE> &GetMloInstanceStore();
static CBaseModelInfo *GetModelInfo(const char *name, int *id); static CBaseModelInfo *GetModelInfo(const char *name, int *id);
static CBaseModelInfo *GetModelInfo(int id){ static CBaseModelInfo *GetModelInfo(int id){
@ -45,6 +46,5 @@ public:
static bool IsBoatModel(int32 id); static bool IsBoatModel(int32 id);
static bool IsBikeModel(int32 id); static bool IsBikeModel(int32 id);
static void RemoveColModelsFromOtherLevels(eLevelName level); static void RemoveColModelsFromOtherLevels(eLevelName level);
static CStore<CInstance, MLOINSTANCESIZE>* CModelInfo::GetMloInstanceStore();
static void ConstructMloClumps(); static void ConstructMloClumps();
}; };

View File

@ -959,7 +959,7 @@ CPlane::CreateDropOffCesna(void)
} }
CVector CPlane::FindDrugPlaneCoordinates(void) { return pDrugRunCesna->GetPosition(); } CVector CPlane::FindDrugPlaneCoordinates(void) { return pDrugRunCesna->GetPosition(); }
CVector CPlane::FindDropOffCesnaCoordinates(void) { return pDrugRunCesna->GetPosition(); } CVector CPlane::FindDropOffCesnaCoordinates(void) { return pDropOffCesna->GetPosition(); }
bool CPlane::HasCesnaLanded(void) { return CesnaMissionStatus == CESNA_STATUS_LANDED; } bool CPlane::HasCesnaLanded(void) { return CesnaMissionStatus == CESNA_STATUS_LANDED; }
bool CPlane::HasCesnaBeenDestroyed(void) { return CesnaMissionStatus == CESNA_STATUS_DESTROYED; } bool CPlane::HasCesnaBeenDestroyed(void) { return CesnaMissionStatus == CESNA_STATUS_DESTROYED; }
bool CPlane::HasDropOffCesnaBeenShotDown(void) { return DropOffCesnaMissionStatus == CESNA_STATUS_DESTROYED; } bool CPlane::HasDropOffCesnaBeenShotDown(void) { return DropOffCesnaMissionStatus == CESNA_STATUS_DESTROYED; }