multitheftauto / mtasa-blue

Multi Theft Auto is a game engine that incorporates an extendable network play element into a proprietary commercial single-player game.
https://multitheftauto.com
GNU General Public License v3.0
1.41k stars 438 forks source link

Vehicle RGB color from map file is not set under certain circumstance #1257

Open patrikjuvonen opened 4 years ago

patrikjuvonen commented 4 years ago

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

ChronosXYZ commented 4 years ago

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

patrikjuvonen commented 4 years ago

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>
Pirulax commented 4 years ago

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