Skip to content

v2.0.2

Latest

Choose a tag to compare

@github-actions github-actions released this 24 Jul 16:37

Fixed

  • RandUUID: Missing null terminator - Copy loop stopped at \0 but 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 - Produced 0xAARRGGBB instead of the documented 0xRRGGBBAA, 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 at 0x00, making colors invisible. Now forced to 0xFF for full opacity, making it directly usable with SetPlayerColor().

  • RandFormat(): Bounds checking added - Size validation (check > 0 and cap at 65536) and pattern buffer handling improved.

  • RandExcMany(): Documentation and logic fixes - Range boundary checks corrected, return value on excluded-all scenario fixed from max to min.

  • RandPickFloat(): Incorrect range - Was using RandRange(0, count - 1), now correctly uses RandRange(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.xz with components/ (open.mp) + plugins/ (SA-MP) + Randomix.inc + CHANGELOG.md
    • Windows: .zip with same structure
    • Release workflow updated to action-gh-release@v2
  • 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 in RandUUID().

  • Build artifacts structure - Organized output into components/ and plugins/ directories for clearer SA-MP vs. open.mp distinction.


Full Changelog: v2.0.1...v2.0.2