ID:2880913
 
Resolved
turn() didn't work correctly with generator objects.
BYOND Version:514
Operating System:Windows 10 Home 64-bit
Web Browser:Firefox 115.0
Applies to:Dream Daemon
Status: Resolved (515.1610)

This issue has been resolved.
Descriptive Problem Summary:
When applying Turn(45) to a generator, I would expect it to rotate 45 degrees. Instead it appears to set the system's initial velocity to 0
Numbered Steps to Reproduce Problem:

Code Snippet (if applicable) to Reproduce Problem:
/*
These are simple defaults for your project.
*/


world
fps = 25 // 25 frames per second
icon_size = 32 // 32x32 icon size by default
maxx = 4
maxy = 4
view = 6 // show up to 6 tiles outward from center (13x13 view)

obj
step_size = 8
particles = new/particles/test

obj/mathtester
particles = new/particles/test/modified

obj/mathtester/proc/make_adjustments() //Rotate the system 90 degreees, apply a leftward drift to the system, and turn it red.
var/generator/number = generator("vector", list(1,6,0), list(-1,6,0), UNIFORM_RAND) //No change regardless of if a new instance is made, or if the original generator is referenced.
particles.velocity = number.Turn(45) //appears to null the velocity?
particles.color = "red"//to show that we're accessing the right thing and properly.


turf
icon = 'test.dmi'


New()
if(x==2 && y==2) // Spawn a reference system at 2,2
new /obj(src) //Reference system.


if(x==1 && y==1) //Spawn our modified system at 1,1 and make it visually clear.
var/obj/mathtester/M = new(src)
M.make_adjustments()
icon_state = "green"

/particles/test //all numbers are arbitrarily chosen.
width = 128
height = 128
count = 600
spawning = 1
lifespan = generator("num", 5, 15)
fade = 3
color_change = 0.1
position = generator("circle" ,0, -0, rand = LINEAR_RAND)
velocity = generator("vector", list(1,6,0), list(-1,6,0), UNIFORM_RAND) //Except this one.

/particles/test/modified
color = "black"


Expected Results:
I expected the system to rotate 45 degrees.
Actual Results:
The system does not impart initial velocity at all.


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.)

Workarounds:
None so far as I can tell, appears to be an engine issue.
I was able to produce runtimes at one point with this but I cannot seem to any longer, unsure why.

It is as such in stddef.dm

    proc/operator_turn(a) return new/generator(turn(_binobj, a))
proc/Turn(a)
_binobj = turn(_binobj, a)
return src
which I have found thus far that it does not provide any insight of note.


Here is a link to my test case.
https://cdn.discordapp.com/attachments/973161106254200872/ 1132580710021091428/bug_report.zip
Lummox JR resolved issue with message:
turn() didn't work correctly with generator objects.