Skip to content

Commit

Permalink
Apply Glide_CanDrawHUD to all vehicle types
Browse files Browse the repository at this point in the history
  • Loading branch information
StyledStrike committed Jan 23, 2025
1 parent 1e74bcd commit a2d2b06
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 0 additions & 1 deletion lua/entities/base_glide_car/cl_init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,6 @@ local w, h, x, y

--- Override this base class function.
function ENT:DrawVehicleHUD( screenW, screenH )
if hook.Run( "Glide_CanDrawHUD", self ) == false then return end
BaseClass.DrawVehicleHUD( self, screenW, screenH )

if not Config.showHUD then return end
Expand Down
6 changes: 5 additions & 1 deletion lua/glide/client/events.lua
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,11 @@ local activeVehicle, activeSeatIndex = NULL, 0
local cvarDrawHud = GetConVar( "cl_drawhud" )

local function DrawVehicleHUD()
if IsValid( activeVehicle ) and cvarDrawHud:GetBool() then
if
IsValid( activeVehicle ) and
cvarDrawHud:GetBool() and
hook.Run( "Glide_CanDrawHUD", activeVehicle ) ~= false
then
activeVehicle:DrawVehicleHUD( ScrW(), ScrH() )
end
end
Expand Down

0 comments on commit a2d2b06

Please sign in to comment.