| View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | ||||||||||||
| ID | Project | Category | View Status | Date Submitted | Last Update | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0006422 | Spring engine | Lua | public | 2020-09-23 17:51 | 2020-09-23 19:48 | ||||||||
| Reporter | Damgam | ||||||||||||
| Assigned To | |||||||||||||
| Priority | normal | Severity | major | Reproducibility | always | ||||||||
| Status | new | Resolution | open | ||||||||||
| Product Version | 104.0 +git | ||||||||||||
| Target Version | Fixed in Version | ||||||||||||
| Summary | 0006422: math.random(x,y) in unitdefs | ||||||||||||
| Description | calling 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 Reproduce | Spring.Echo(math.random(1,someothernumber)) in any unitdef file, prefferably multiple times | ||||||||||||
| Additional Information | none | ||||||||||||
| Tags | lua math | ||||||||||||
| Checked infolog.txt for Errors | Yes | ||||||||||||
| Attached Files |
| ||||||||||||
Notes |
|
|
sprung (reporter) 2020-09-23 19:11 |
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 (reporter) 2020-09-23 19:48 |
I've figured that out by myself. |


