Fixing pointer check

This commit is contained in:
bernat 2023-04-24 14:40:19 +02:00
parent 7a58cab708
commit 508f3b9141
1 changed files with 14 additions and 4 deletions

View File

@ -17,6 +17,8 @@
#include "Carla/Walker/WalkerControl.h"
#include "Carla/Walker/WalkerController.h"
#include "Components/BoxComponent.h"
#include "Components/SkeletalMeshComponent.h"
#include "VehicleAnimInstance.h"
#include <compiler/disable-ue4-macros.h>
#include "carla/rpc/VehicleLightState.h"
@ -207,14 +209,22 @@ void ACarlaRecorder::AddVehicleWheelsAnimation(FCarlaActor *CarlaActor)
return;
if (CarlaActor->GetActorType() != FCarlaActor::ActorType::Vehicle)
return;
ACarlaWheeledVehicle* CarlaVehicle = Cast<ACarlaWheeledVehicle>(CarlaActor->GetActor());
check(CarlaVehicle != nullptr)
if (CarlaVehicle == nullptr)
return;
USkeletalMeshComponent* SkeletalMesh = CarlaVehicle->GetMesh();
check(SkeletalMesh != nullptr)
if (SkeletalMesh == nullptr)
return;
UVehicleAnimInstance* VehicleAnim = Cast<UVehicleAnimInstance>(SkeletalMesh->GetAnimInstance());
check(VehicleAnim != nullptr)
if (VehicleAnim == nullptr)
return;
const UWheeledVehicleMovementComponent* WheeledVehicleMovementComponent = VehicleAnim->GetWheeledVehicleMovementComponent();
check(WheeledVehicleMovementComponent != nullptr)
if (WheeledVehicleMovementComponent == nullptr)
return;
CarlaRecorderAnimWheels Record;
Record.DatabaseId = CarlaActor->GetActorId();