2024-04-16 18:18 CEST

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0005976Spring engineGeneralpublic2018-05-08 18:43
Reporterlhog 
Assigned ToKloot 
PrioritynormalSeverityminorReproducibilityalways
StatusresolvedResolutionfixed 
Product Version104.0 +git 
Target VersionFixed in Version 
Summary0005976: Something is wrong with math.random(lower, upper)
DescriptionTesting on 104.0.1-287-gf7b0fcc maintenance and getting totally ridiculous error in the following minimal widget:


function widget:GetInfo()
  return {
    name = "TEST RANDOM",
    enabled = true -- loaded by default?
  }
end


function widget:Initialize()
    Spring.Echo("HELLLOOO")
    Spring.Echo(math.random(-3000, 3000))
end


Infolog:
[f=0060843] HELLLOOO
[f=0060843] [cawidgets.lua] Error: Error in Initialize(): [string "LuaUI/Widgets/precipitation_particles.lua"]:24: bad argument #2 to 'random' ([spring_lua_unsynced_rand(lower, upper)] empty interval)

math.random(upperBound) or math.random() work just fine.

Steps To ReproduceGuess, test the widget code above on the 104.0.1-287-gf7b0fcc maintenance
Additional InformationNoticed rain stopped working on Onyx Cauldron map and found this...
TagsNo tags attached.
Checked infolog.txt for Errors
Attached Files

-Relationships
+Relationships

-Notes

~0019087

Kloot (developer)

Fix e5979d12ae3ec8a492cc9b3b753e54e0cc24c400 committed to develop branch: fix 0005976, repo: spring changeset id: 10226

~0019088

Kloot (developer)

Fix b0874231e19121607979e1f226653992dd8225e7 committed to maintenance branch: fix 0005976, repo: spring changeset id: 10229
+Notes

-Issue History
Date Modified Username Field Change
2018-05-08 17:08 lhog New Issue
2018-05-08 18:41 Kloot Changeset attached => spring develop e5979d12
2018-05-08 18:41 Kloot Note Added: 0019087
2018-05-08 18:41 Kloot Assigned To => Kloot
2018-05-08 18:41 Kloot Status new => resolved
2018-05-08 18:41 Kloot Resolution open => fixed
2018-05-08 18:43 Kloot Changeset attached => spring maintenance b0874231
2018-05-08 18:43 Kloot Note Added: 0019088
+Issue History