ID:2660264
 
Resolved
rgb2num() could crash the compiler in some cases.
BYOND Version:514.1548
Operating System:Windows 10 Pro 64-bit
Web Browser:Chrome 88.0.4324.190
Applies to:Dream Maker
Status: Resolved (514.1549)

This issue has been resolved.
Descriptive Problem Summary:
Dream Maker crashes during compiling when converting hex color value with rgb2num()
Numbered Steps to Reproduce Problem:
Create an hex color with a list to desired colors pace, then use the converted color value to a different color space.

Code Snippet (if applicable) to Reproduce Problem:
client
verb
SwitchColorspace1() // Crashes
var
values[] = list(153, 234, 51)
from_space = COLORSPACE_RGB
to_space = COLORSPACE_HSV
from_color = rgb(values[1], values[2], values[3], space = from_space)
to_color[] = rgb2num(from_color, to_space)
src << json_encode(from_color)
src << json_encode(to_color)
SwitchColorspace2() // Works
var
to_space = COLORSPACE_HSV
to_color[] = rgb2num("#99ea33", to_space)
src << json_encode(to_color)


Expected Results:
No crash, proper conversion to desired output values.

Actual Results:
Dream Maker crashes.

Does the problem occur:
Every time? Or how often? Yes, every time.
In other games? Yes.
In other user accounts? Yes.
On other computers? Yes.

When does the problem NOT occur?
When the hex value for the color is created manually.

Did the problem NOT occur in any earlier versions? If so, what was the last version that worked? (Visit http://www.byond.com/download/build to download old versions for testing.)
Unsure as it is a new feature.

Workarounds:
Unknown.

Lummox JR resolved issue with message:
rgb2num() could crash the compiler in some cases.