Skip to content

Commit

Permalink
Use PreRender hook to capture radar terrain
Browse files Browse the repository at this point in the history
  • Loading branch information
StyledStrike committed Dec 14, 2024
1 parent ffd9a80 commit de2e16a
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lua/gminimap/client/radar.lua
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,14 @@ function Radar:Draw()
self.lastGridX = gridPos[1]
self.lastGridY = gridPos[2]

self.lastCapturePos = gridPos
self:Capture( gridPos )
local hookId = "GMinimap.Capture_" .. self.rtId

hook.Add( "PreRender", hookId, function()
hook.Remove( "PreRender", hookId )

self.lastCapturePos = gridPos
self:Capture( gridPos )
end )
end

-- When the origin moves away from out last captured position,
Expand Down

0 comments on commit de2e16a

Please sign in to comment.