Skip to content

Commit

Permalink
gui_metalspots: Avoid rechecking metalspots all the time until gamest…
Browse files Browse the repository at this point in the history
…art. (#3903)

* Avoid rechecking metalspots all the time until gamestart.

* Actually make it check initially.
  • Loading branch information
saurtron authored Nov 13, 2024
1 parent 2a396e2 commit 7961f01
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions luaui/Widgets/gui_metalspots.lua
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ if Spring.GetModOptions().unit_restrictions_noextractorDefs then
return
end


local needsInit = true
local showValue = false
local metalViewOnly = false

Expand Down Expand Up @@ -527,8 +527,9 @@ function widget:DrawWorldPreUnit()
drawInstanceVBO(spotInstanceVBO)
spotShader:Deactivate()

if Spring.GetGameFrame() == 0 then
if needsInit and Spring.GetGameFrame() == 0 then
checkMetalspots()
needsInit = false
end

gl.Texture(0, false)
Expand Down

0 comments on commit 7961f01

Please sign in to comment.