Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More INVALID constants #19

Open
WoutProvost opened this issue Jul 12, 2019 · 2 comments
Open

More INVALID constants #19

WoutProvost opened this issue Jul 12, 2019 · 2 comments

Comments

@WoutProvost
Copy link

WoutProvost commented Jul 12, 2019

Add commonly used INVALID constants, taken from here:

#define INVALID_SKIN_ID					-1
#define INVALID_MODEL_ID				-1
#define INVALID_CHECKPOINT_ID				-1
#define INVALID_MAPICON_ID				-1
#define INVALID_PICKUP_ID				-1
#define INVALID_AREA_ID					-1
#define INVALID_TIMER_ID				-1
#define INVALID_VIRTUAL_WORLD_ID			-1
#define INVALID_INTERIOR_ID				-1
#define INVALID_CLASS_ID				-1
#define INVALID_PAINTJOB_ID				-1
#define INVALID_VEHICLE_COLOR_ID			-2
#define INVALID_WEAPON_ID				-1

There might be others I haven't thought of.

@Daniel-Cortez
Copy link
Contributor

Daniel-Cortez commented Jul 14, 2019

#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.

@WoutProvost
Copy link
Author

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
pawn-lang/sa-mp-fixes#36

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants