From e9b334d7bf270682f83c5c18b2d85a25703c1a2d Mon Sep 17 00:00:00 2001 From: Sergeanur Date: Tue, 5 May 2020 14:48:35 +0300 Subject: More use of GetModelIndex --- src/core/AnimViewer.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/core/AnimViewer.cpp') diff --git a/src/core/AnimViewer.cpp b/src/core/AnimViewer.cpp index b4763627..992dffb5 100644 --- a/src/core/AnimViewer.cpp +++ b/src/core/AnimViewer.cpp @@ -369,10 +369,11 @@ CAnimViewer::Update(void) if (pad->NewState.Triangle) { #ifdef PED_SKIN if(IsClumpSkinned(pTarget->GetClump())) - ((CPedModelInfo*)CModelInfo::GetModelInfo(pTarget->m_modelIndex))->AnimatePedColModelSkinned(pTarget->GetClump()); + ((CPedModelInfo *)CModelInfo::GetModelInfo(pTarget->GetModelIndex()))->AnimatePedColModelSkinned(pTarget->GetClump()); else #endif - CPedModelInfo::AnimatePedColModel(((CPedModelInfo*)CModelInfo::GetModelInfo(pTarget->m_modelIndex))->GetHitColModel(), RpClumpGetFrame(pTarget->GetClump())); + CPedModelInfo::AnimatePedColModel(((CPedModelInfo *)CModelInfo::GetModelInfo(pTarget->GetModelIndex()))->GetHitColModel(), + RpClumpGetFrame(pTarget->GetClump())); AsciiToUnicode("Ped Col model will be animated as long as you hold the button", gUString); CMessages::AddMessage(gUString, 100, 0); } -- cgit v1.2.3 From 4cc1bb92e74eaabe9d5ef3d20fb658d577699fa9 Mon Sep 17 00:00:00 2001 From: Sergeanur Date: Tue, 5 May 2020 15:06:55 +0300 Subject: Make CBaseModelInfo fields protected --- src/core/AnimViewer.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/core/AnimViewer.cpp') diff --git a/src/core/AnimViewer.cpp b/src/core/AnimViewer.cpp index 992dffb5..00d39066 100644 --- a/src/core/AnimViewer.cpp +++ b/src/core/AnimViewer.cpp @@ -148,7 +148,7 @@ LastPedModelId(int modelId) CBaseModelInfo *model; for (int i = modelId; i >= 0; i--) { model = CModelInfo::GetModelInfo(i); - if (model->m_type == MITYPE_PED) + if (model->GetModelType() == MITYPE_PED) return i; } return modelId; @@ -160,7 +160,7 @@ LastVehicleModelId(int modelId) CBaseModelInfo* model; for (int i = modelId; i >= 0; i--) { model = CModelInfo::GetModelInfo(i); - if (model->m_type == MITYPE_VEHICLE) + if (model->GetModelType() == MITYPE_VEHICLE) return i; } return modelId; @@ -222,7 +222,7 @@ CAnimViewer::Update(void) CBaseModelInfo *modelInfo = CModelInfo::GetModelInfo(modelId); CEntity *newEntity = nil; - if (modelInfo->m_type == MITYPE_PED) { + if (modelInfo->GetModelType() == MITYPE_PED) { int animGroup = ((CPedModelInfo*)modelInfo)->m_animGroup; if (animId > ANIM_IDLE_STANCE) @@ -257,7 +257,7 @@ CAnimViewer::Update(void) if (!pTarget) { - if (modelInfo->m_type == MITYPE_VEHICLE) { + if (modelInfo->GetModelType() == MITYPE_VEHICLE) { CVehicleModelInfo* veh = (CVehicleModelInfo*)modelInfo; if (veh->m_vehicleType != VEHICLE_TYPE_CAR) { @@ -281,7 +281,7 @@ CAnimViewer::Update(void) newEntity->SetStatus(STATUS_ABANDONED); } newEntity->bIsStuck = true; - } else if (modelInfo->m_type == MITYPE_PED) { + } else if (modelInfo->GetModelType() == MITYPE_PED) { pTarget = newEntity = new CPed(PEDTYPE_CIVMALE); newEntity->SetModelIndex(modelId); } else { @@ -301,9 +301,9 @@ CAnimViewer::Update(void) } pTarget->GetMatrix().GetPosition().z = 0.0f; - if (modelInfo->m_type != MITYPE_PED) { + if (modelInfo->GetModelType() != MITYPE_PED) { - if (modelInfo->m_type == MITYPE_VEHICLE) { + if (modelInfo->GetModelType() == MITYPE_VEHICLE) { if (pad->NewState.LeftShoulder1 && !pad->OldState.LeftShoulder1) { nextModelId = LastPedModelId(modelId); -- cgit v1.2.3