Prevent from segfault OnTriggerEndOverlap

In case the OtherActor is not a Vehicle just return
This commit is contained in:
Bernd Gassmann 2022-10-17 11:01:10 +02:00 committed by bernat
parent 39a827e061
commit 6c4d676569
2 changed files with 4 additions and 0 deletions

View File

@ -1,5 +1,6 @@
## Latest
* Fixed bug in FrictionTrigger causing sometimes server segfault
* Added attachment type "SpringArmGhost" for cinematic cameras but without doing the collision test.
* Improved algorithm to move signals out of the road by computing the desired displacement direction.
* Added `TrafficManager.vehicle_lane_offset(actor, offset)` and `TrafficManager.global_lane_offset(offset)` methods.

View File

@ -71,6 +71,9 @@ void AFrictionTrigger::OnTriggerEndOverlap(
UpdateWheelsFriction(OtherActor, OldFrictionValues);
ACarlaWheeledVehicle *Vehicle = Cast<ACarlaWheeledVehicle>(OtherActor);
if(Vehicle == nullptr)
return;
TArray<float> CurrFriction = Vehicle->GetWheelsFrictionScale();
}