Mtasa-blue: Vehicle RGB color from map file is not set under certain circumstance

Created on 22 Feb 2020  路  3Comments  路  Source: multitheftauto/mtasa-blue

Describe the bug
If the color attribute, provided in RGB, for a vehicle in map file is same as current m_Color (currently both RGB and palette are initialized as 0, 0, 0, 0 in CVehicleColor), the provided color will be ignored and will use randomized color.

To reproduce
Will not be set (interpreted as RGB):

<vehicle color="0,0,0"></vehicle>
<vehicle color="0,0,0,0,0,0"></vehicle>
<vehicle color="0,0,0,0,0,0,0,0,0"></vehicle>
<vehicle color="0,0,0,0,0,0,0,0,0,0,0,0"></vehicle>

Will be set (interpreted as RGB different from own RGB value):

<vehicle color="0,0,1"></vehicle>
<vehicle color="0,0,0,0,0,1"></vehicle>
<vehicle color="0,0,0,0,0,0,0,0,1"></vehicle>
<vehicle color="0,0,0,0,0,0,0,0,0,0,0,1"></vehicle>

Will be set (interpreted as palette color):

<vehicle color="0"></vehicle>
<vehicle color="0,0"></vehicle>
<vehicle color="0,0,0,0"></vehicle>
<vehicle color="0,0,0,0,0"></vehicle>
<vehicle color="0,0,0,0,0,0"></vehicle>
<vehicle color="0,0,0,0,0,0,0"></vehicle>
<vehicle color="0,0,0,0,0,0,0,0"></vehicle>
<vehicle color="0,0,0,0,0,0,0,0,0,0"></vehicle>
<vehicle color="0,0,0,0,0,0,0,0,0,0,0"></vehicle>
<vehicle color="0,0,0,0,0,0,0,0,0,0,0,0,0"></vehicle>

Expected behaviour
Vehicle color should be set to the provided color.

Version
Multi Theft Auto v1.5.7-release-20402

Additional context

  • First discovered in #263
bug

All 3 comments

Any news about this issue? Is there a workaround for this?

Any news about this issue? Is there a workaround for this?

For now you can use the black color provided by the palette, for example:

<vehicle color="0"></vehicle>
<vehicle color="0,0"></vehicle>
<vehicle color="0,0,0,0"></vehicle>

Will not work:

<vehicle color="0,0,0"></vehicle>

"backwards compatibility" nah. Is there any kind of version attribute in the map file? Or would this really be an issue?

Was this page helpful?
0 / 5 - 0 ratings