Repository navigation
Fixed
-
RandUUID: Missing null terminator - Copy loop stopped at\0but never wrote the terminating cell, leaving stale data when the array was reused. Now writes the null terminator after the copy loop in both open.mp and SA-MP builds. -
RandColorAlpha(alpha): Wrong byte order - Produced0xAARRGGBBinstead of the documented0xRRGGBBAA, causing alpha byte to land on red channel. Alpha is now properly masked(alpha & 0xFF)and placed in the low byte. -
RandColor(): Fully transparent alpha - Alpha byte was left at0x00, making colors invisible. Now forced to0xFFfor full opacity, making it directly usable withSetPlayerColor(). -
RandFormat(): Bounds checking added - Size validation (check> 0and cap at 65536) and pattern buffer handling improved. -
RandExcMany(): Documentation and logic fixes - Range boundary checks corrected, return value on excluded-all scenario fixed frommaxtomin. -
RandPickFloat(): Incorrect range - Was usingRandRange(0, count - 1), now correctly usesRandRange(0, count)for[0, count).
Changed
-
Refactored CI/CD workflow - Now builds both open.mp and SA-MP variants in parallel (instead of conditional selection) and packages them into structured archives:
- Linux:
.tar.xzwithcomponents/(open.mp) +plugins/(SA-MP) +Randomix.inc+CHANGELOG.md - Windows:
.zipwith same structure - Release workflow updated to
action-gh-release@v2
- Linux:
-
Documentation clarifications - Many function comments updated to explicitly state
[min, max)range semantics and fix parameter descriptions. -
Version bump: 2.0.1 → 2.0.2 across CMakeLists.txt, Randomix.inc, main.cpp, main_samp.cpp, randomix_impl.hpp
Improvements
-
Enhanced bounds checking -
RandFormat()now validates size bounds (0 < size ≤ 65536) and uses thread-local static buffer instead of stack-limited allocation. -
Cleaner code patterns - Simplified pattern buffer copying in
RandFormat()and improved null terminator handling inRandUUID(). -
Build artifacts structure - Organized output into
components/andplugins/directories for clearer SA-MP vs. open.mp distinction.
Full Changelog: v2.0.1...v2.0.2