- New native
RandPointInArc()- Generate random point in circular sector - New stock functions:
RandInt(min, max)- Alias for RandRangeRandAngle()- Random angle [0, 2π) in radiansRandSign()- Random +1 or -1RandColorAlpha(alpha)- RGBA color with alphaRandVecInRange(min, max, &x, &y, &z)- Random 3D vectorRandLoot(itemIds, weights, count)- Weighted loot table selectionRandPointInCircleAroundPlayer(playerid, radius, &x, &y)- Spawn around player
- New macros:
RandD2()throughRandD100()- D&D dice macrosRandShuf(array)- Shuffle array shorthandRandShufRange(array, start, end)- Shuffle range shorthandRandElem(array, size)- Random element accessorRandEither(opt1, opt2)- Pick one of two optionsRandChance(percent)- Percentage chance shorthand
- Mathematical constants:
RANDIX_PI,RANDIX_TWO_PI,RANDIX_HALF_PI - Angle conversion macros:
Deg2Rad(),Rad2Deg() [[nodiscard]]attributes on ChaChaRNG methods.dockerignorefile for faster Docker builds- Docker updated to Ubuntu 22.04 with Clang 14
- BREAKING:
RandRange(min, max)now returns [min, max) instead of [min, max]- Now matches SA-MP's half-open range convention
Random(10)andRandRange(0, 10)both return 0-9
- Code deduplication: Created
randomix_impl.hppshared header- Eliminated ~90% duplicate code between SA-MP and open.mp builds
- Renamed stocks for consistency:
RandomColor()→RandColor()RandomColorAlpha()→RandColorAlpha()RandomSign()→RandSign()RandExcept()→RandExc()RandExceptMany()→RandExcMany()RandHexString()→RandHex()RandString()→RandStr()ShuffleArray()→RandShuf()ShuffleArrayRange()→RandShufRange()RandomElement()→RandElem()RandomPick()→RandEither()RandomChance()→RandChance()RollD*()→RandD*()DegToRad()→Deg2Rad()RadToDeg()→Rad2Deg()
- Simplified code comments (removed
// ===blocks) - Updated load/unload messages with version info
- CI/CD now builds both open.mp and SA-MP variants
RandPointInPolygon: Replaced heap allocation with stack buffer- Fixed performance issue with
std::vector<float>
- Fixed performance issue with
- Added comprehensive bounds checking:
- NaN/Inf detection for all float inputs
- Integer overflow protection in weighted functions
- Sanity limits on array sizes and iterations
- Fixed typo in documentation: "untuk" → "for"
- Fixed redundant null check in
onFree()handler - Fixed CMake compatibility with
-DCMAKE_POLICY_VERSION_MINIMUM=3.5 - Removed unused
minSizeparameter fromCheckArrayBounds() - Fixed
RandLootsizeof reliability issue
- ChaCha20 CSPRNG with 256-bit key, 64-bit nonce
- Auto-reseed after 1GB of generated data
- Thread-safe with mutex protection
- Secure memory scrubbing in destructor
- ChaCha20-based CSPRNG
- SA-MP and open.mp support
- Core functions:
RandRange,RandFloatRange,RandBool,RandWeighted - Array operations:
RandShuffle,RandPick - String/Token:
RandFormat,RandBytes,RandUUID - Statistics:
RandGaussian,RandDice - 2D Geometry: Circle, Ring, Ellipse, Triangle, Rectangle, Polygon
- 3D Geometry: Sphere, Box
- Helper stocks:
Random,RandomFloat,RandExcept,RandomColor, etc.