Permalink
Browse files

Check for vehicle function existence

  • Loading branch information...
1 parent fcf7ac7 commit 001070eb12eb589e1469cd91f3a91bfafbb6bdad @robotboy655 robotboy655 committed Jan 22, 2016
Showing with 2 additions and 2 deletions.
  1. +2 −2 garrysmod/gamemodes/base/gamemode/shared.lua
@@ -216,15 +216,15 @@ function GM:VehicleMove( ply, vehicle, mv )
--
-- On duck toggle third person view
--
- if ( mv:KeyPressed( IN_DUCK ) ) then
+ if ( mv:KeyPressed( IN_DUCK ) && vehicle.SetThirdPersonMode ) then
vehicle:SetThirdPersonMode( !vehicle:GetThirdPersonMode() )
end
--
-- Adjust the camera distance with the mouse wheel
--
local iWheel = ply:GetCurrentCommand():GetMouseWheel()
- if ( iWheel != 0 ) then
+ if ( iWheel != 0 && vehicle.SetCameraDistance ) then
-- The distance is a multiplier
-- Actual camera distance = ( renderradius + renderradius * dist )
-- so -1 will be zero.. clamp it there.

0 comments on commit 001070e

Please sign in to comment.