altmp / altv-issues

Issues and roadmap for alt:V project
93 stars 16 forks source link

Blip.color doesn't work when setting before blip.sprite #1616

Open TheDutchDev opened 2 years ago

TheDutchDev commented 2 years ago

Description of the problem

When creating an alt.PointBlip client-side and setting the color property BEFORE setting the sprite property, the color will always be white.

Minor issue, but can still be very confusing as there are no warnings/errors given when doing this.

Reproduction steps

This one won't work

    missionBlip = new alt.PointBlip( x, y, z );
    missionBlip.color = 64; // gold color
    missionBlip.sprite = 1;

This one will work:

    missionBlip = new alt.PointBlip( x, y, z );
    missionBlip.sprite = 1;
    missionBlip.color = 64; // gold color

Expected behaviour

Color should work even when setting it before sprite.

Additional context

Since sprite can be set at any given time, the simplest solution might just be to re-apply the color after sprite has changed.

Operating system

Windows 10

Version

Release 12.10

LeonMrBonnie commented 2 years ago

This is just how GTA works so I am unsure if we want to fix this

FabianTerhorst commented 2 years ago

I think we can workaround it in client code in the future.

C0kkie commented 1 year ago

@QuiGonJinnAndTonic Could you test in newest dev?