14 Commits
Author SHA1 Message Date
Anders Jenbo 005e7dcc23 chore: clang-tidy cleanup part 1 2026-04-03 22:57:48 +02:00
Stephen C. Wills cfe9a8ccdd Introduce xoshiro RNG to generate dungeon seeds (#7030) 2024-09-17 23:34:44 +02:00
Gleb Mazovetskiy 62d067b653 Remove utils/stdcompat/abs.hpp 2023-08-14 01:54:29 +01:00
Gleb Mazovetskiy 4fa3732526 Add missing <cstdint> includes
Done with the following script:

```ruby
Dir["Source/**/*.{h,c,cc,cpp,hpp}"].each do |path|
  v = File.read(path)
  next if !v.include?("uint32_t") || v.include?("cstdint")

  lines = v.lines
  line_num = if lines[2].start_with?(" *")
    lines.index { |l| l.start_with?(" */") } + 3
  else
    3
  end

  lines.insert(line_num, "#include <cstdint>\n")

  File.write(path, lines.join(""))
end
```

then fixed-up manually
2023-05-10 13:50:12 +01:00
ephphatha c3a8a95813 use stdlib lcg type 2023-05-07 16:35:03 +02:00
ephphatha 3bbb80d849 Introduce temporary function to advance the global rng state and discard results 2023-05-07 16:35:03 +02:00
ephphatha b98e5fcfad split logic responsible for advancing global generator state to a dedicated function
Exposing this also allows updating the engine test case to avoid peeking at the engine state after a roll, also will be useful for setting item/object seeds
2023-05-07 16:35:03 +02:00
ephphatha bc0a058350 Invert FlipCoin 2022-07-10 02:37:33 +02:00
Cesar Canassa bb3fb36ddc ✨ Introduces FlipCoin() (#4908) 2022-07-07 20:57:03 +02:00
ephphatha 8d0afac194 Don't preserve an unreachable vanilla bug 2022-06-14 16:21:00 +02:00
Dmitry Marakasov 04d0950c9e Fix UB in random generator
abs(INT_MIN) is undefined behavior, so process this case without
calling abs()
2022-05-18 04:40:54 +02:00
Anders Jenbo 0f2ad469ea ♻️Clean up variable initialization 2021-06-27 14:58:51 -07:00
ephphatha 921c7af8c6 Expand comments for vanilla RNG functions
And put them in the header 😂
2021-06-27 04:14:18 -07:00
ephphatha 357f6f1dc3 Move RNG functions to their own header/source files 2021-06-27 03:09:41 -07:00