Page 1 of 1

SetShareLevel() does not work

Posted: 04 Feb 2008, 06:32
by Lupus
Hello there.
I'm trying to write a simple widget, to set sharing resources level at the beginning of each game.
I've found the function described in API.txt:
SetShareLevel(string "metal" | "energy", number fraction) -> nil

I wrote a widget:

Code: Select all

function widget:GetInfo() 
  return { name = "MyWidget" }
end

function widget:Initialize()
  Spring.SetShareLevel("metal", 0.9)
  Spring.SetShareLevel("energy", 0.8)
end
The energy is set to 0.8, but the metal isn't!
Only the second call of the function SetShareLevel() is evaluated, the first one isn't...
Why is that?