pawn-lang / sa-mp-fixes

Includes and plugins to fix various issues in the SA:MP server that can be fixed externally, leaving the devs time for other things.
135 stars 57 forks source link

GetVehicleComponent fix #149

Closed Mergevos closed 2 years ago

Mergevos commented 2 years ago

fixes #136

Y-Less commented 2 years ago

That's looking way better. There are a few other minor changes, but I might handle them as they're a bit hard to explain. You've switched from only supporting one script to supporting multiple scripts, which is good, but that should be a compile-time option, for which there are a few macros. As I said, don't worry about that.

One big question is, though - what happens when a vehicle is recreated? None of the variables are reset, so a new vehicle will inherit all the mods from the previous vehicle with that ID.

Mergevos commented 2 years ago

That's looking way better. There are a few other minor changes, but I might handle them as they're a bit hard to explain. You've switched from only supporting one script to supporting multiple scripts, which is good, but that should be a compile-time option, for which there are a few macros. As I said, don't worry about that.

It's FIXES_Single, isn't it?

One big question is, though - what happens when a vehicle is recreated? None of the variables are reset, so a new vehicle will inherit all the mods from the previous vehicle with that ID.

Ye, I can hook CreateVehicle and DestroyVehicle functions but what's gonna happen if someone wants to fix -1 colors?

Mergevos commented 2 years ago

@Y-Less check if https://github.com/pawn-lang/sa-mp-fixes/pull/149/commits/91d44fd53e96adb5b6df59db7296a6871238f2fb commit is adequate for cross-script mode

Mergevos commented 2 years ago

Think https://github.com/pawn-lang/sa-mp-fixes/pull/149/commits/9d693bcc538fb79146c1436c668a0f1983673ea2 commit has everything done.

Y-Less commented 2 years ago

I'm also slightly concerned about CARMODTYPE_STEREO conflicting with YSI code. Maybe use a constant offset as well for the components, like:

#define _FIXES_PROPERTY_OFFSET (10)

setproperty(CARMODTYPE_STEREO + _FIXES_PROPERTY_OFFSET, ...);

Should still compile to a constant.

Y-Less commented 2 years ago

Then I think its ready.

Mergevos commented 2 years ago

I'm also slightly concerned about CARMODTYPE_STEREO conflicting with YSI code. Maybe use a constant offset as well for the components, like:

#define _FIXES_PROPERTY_OFFSET (10)

setproperty(CARMODTYPE_STEREO + _FIXES_PROPERTY_OFFSET, ...);

Should still compile to a constant.

Finished this, not yet pushed.

Mergevos commented 2 years ago

You shouldn't need to use FIXES_valstr, you won't ever pass it cellmin.

However, if you do need to use it, the correct way would be to continue calling valstr__ and rearrange the file so that that fix comes first.

there's no valstr__ if I see correctly.

Mergevos commented 2 years ago

10c5d26 d4657d1 2189615

check these

Mergevos commented 2 years ago

Why isn't this merged yet?

Y-Less commented 2 years ago

That's a very good question...