Skip to content

Commit

Permalink
Fix set_player_mode
Browse files Browse the repository at this point in the history
  • Loading branch information
aivora-beamng committed Apr 4, 2023
1 parent df97d29 commit 6f1e047
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/beamngpy/api/beamng/camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def set_player_mode(self, vehicle: str | Vehicle, mode: str, config: StrDict, cu
custom_data: Custom data used by the specific camera mode. Defaults to None.
"""
data: StrDict = dict(type='SetPlayerCameraMode')
data['vid'] = vehicle.vid if isinstance(vehicle, Vehicle) else vehicle
data['vid'] = vehicle if isinstance(vehicle, str) else vehicle.vid
data['mode'] = mode
data['config'] = config
data['customData'] = custom_data
Expand All @@ -98,7 +98,7 @@ def get_player_modes(self, vehicle: str | Vehicle) -> StrDict:
A dictionary mapping camera mode names to configuration options.
"""
data = dict(type='GetPlayerCameraMode')
data['vid'] = vehicle.vid if isinstance(vehicle, Vehicle) else vehicle
data['vid'] = vehicle if isinstance(vehicle, str) else vehicle.vid
resp = self._send(data).recv('PlayerCameraMode')
return resp['cameraData']

Expand Down

0 comments on commit 6f1e047

Please sign in to comment.