Open WoutProvost opened 5 years ago
define INVALID_VEHICLE_COLOR_ID -2
How is this one "invalid"? When you pass a vehicle color ID to SA-MP natives (ChangeVehicleColor
, for example), the value gets truncated to just one byte, so for INVALID_VEHICLE_COLOR_ID
the value -2
(0xFFFFFFFE
) will be treated as 254
(0xFE
), which is a valid color ID.
Just see it as having a special meaning, in the same way that often -1 has a special meaning for vehicle colors: https://forum.sa-mp.com/showthread.php?t=339088 https://github.com/Open-GTO/sa-mp-fixes/issues/36
Add commonly used INVALID constants, taken from here:
There might be others I haven't thought of.