View Issue Details

IDProjectCategoryView StatusLast Update
0006422Spring engineLuapublic2020-09-23 19:48
ReporterDamgam Assigned To 
PrioritynormalSeveritymajorReproducibilityalways
Status newResolutionopen 
Product Version104.0 +git 
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
Attached Files
Bez tytułu.jpg (Attachment missing)
Checked infolog.txt for ErrorsYes

Activities

sprung

2020-09-23 19:11

reporter   ~0020536

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

Damgam

2020-09-23 19:48

reporter   ~0020537

I've figured that out by myself.

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