More efficient way of retrieving traffic light actor

This commit is contained in:
nsubiron 2019-06-13 12:23:38 +02:00
parent 84d4b7c5b9
commit 3934cbcfbd
1 changed files with 1 additions and 2 deletions

View File

@ -65,8 +65,7 @@ namespace client {
SharedPtr<TrafficLight> Vehicle::GetTrafficLight() const {
auto id = GetEpisode().Lock()->GetActorDynamicState(*this).state.vehicle_data.traffic_light_id;
SharedPtr<Actor> actor = GetWorld().GetActors()->Find(id);
return boost::static_pointer_cast<TrafficLight>(actor);
return boost::static_pointer_cast<TrafficLight>(GetWorld().GetActor(id));
}
} // namespace client