2020-10-29 09:23 CET

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0006422Spring engineLuapublic2020-09-23 19:48
ReporterDamgam 
Assigned To 
PrioritynormalSeveritymajorReproducibilityalways
StatusnewResolutionopen 
Product Version104.0 +git 
Target VersionFixed in Version 
Summary0006422: math.random(x,y) in unitdefs
Descriptioncalling math.randon(1,10) in LuaParser enviroment (Unit def file) returns random values between 0 and 1 like there were no arguments at all.
Steps To ReproduceSpring.Echo(math.random(1,someothernumber)) in any unitdef file, prefferably multiple times
Additional Informationnone
Tagslua math
Checked infolog.txt for ErrorsYes
Attached Files

-Relationships
+Relationships

-Notes

~0020536

sprung (reporter)

The "real" random is https://github.com/spring/spring/blob/develop/rts/Lua/LuaHandleSynced.cpp#L1367 but defs parsing uses https://github.com/spring/spring/blob/develop/rts/Lua/LuaParser.cpp#L521

~0020537

Damgam (reporter)

I've figured that out by myself.
+Notes

-Issue History
Date Modified Username Field Change
2020-09-23 17:51 Damgam New Issue
2020-09-23 17:52 Damgam File Added: Bez tytułu.jpg
2020-09-23 17:52 Damgam Tag Attached: lua math
2020-09-23 19:11 sprung Note Added: 0020536
2020-09-23 19:48 Damgam Note Added: 0020537
+Issue History