openmultiplayer / omp-stdlib

Pawn includes
Mozilla Public License 2.0
41 stars 17 forks source link

Fix type punning with `VEHICLE_PARAMS_UNSET` and `bool:undefined` #26

Closed NexiusTailer closed 1 month ago

NexiusTailer commented 9 months ago

The first one is declared here. The second one is here and it's used in a lot of functions (like SetVehicleParamsForPlayer, SetVehicleParamsEx, etc) which don't allow bool parameters by its design at all, as they have 3 possible values instead of just true/false. Type punning is not the solution for all those places, each case just should be as integer parameter.

UPD: The main problem besides bad practice is that it's not backwards compatible with scripts which hooks anything with those parameters, and they cannot be done as bool there (because they never was in this way and still is not as well), even if custom tags is disabled via #define NO_TAGS.