mirror of
https://github.com/rwengine/openrw.git
synced 2024-11-26 12:22:41 +01:00
Fix segfault when player is not in vehicle
This commit is contained in:
parent
2b0952557a
commit
fbe0738fb4
@ -34,13 +34,14 @@ void GTAPlayerAIController::update(float dt)
|
||||
|
||||
if( character->getCurrentVehicle() ) {
|
||||
character->getCurrentVehicle()->setSteeringAngle(-direction.x * 3.131f);
|
||||
|
||||
// TODO what is handbraking.
|
||||
character->getCurrentVehicle()->setThrottle(direction.y);
|
||||
}
|
||||
else if( glm::length(direction) > 0.001f ) {
|
||||
character->rotation = cameraRotation * glm::quat(glm::vec3(0.f, 0.f, -atan2(direction.x, direction.y)));
|
||||
}
|
||||
|
||||
// TODO what is handbraking.
|
||||
character->getCurrentVehicle()->setThrottle(direction.y);
|
||||
}
|
||||
|
||||
glm::vec3 GTAPlayerAIController::getTargetPosition()
|
||||
|
Loading…
Reference in New Issue
Block a user