Right now
tovector("cake")
Returns a zero vector and it should probably return
nil
instead
This is how
tonumber
works for instance.
It would also allow for easy testing of if a string is a vector
Current behavior
tovector("cake") -- <0.0, 0.0, 0.0>
tovector("<0,0,as>") -- <0.0, 0.0, 0.0>
tovector("<0,0,0") -- <0.0, 0.0, 0.0>
tovector("<0,0,0>") -- <0.0, 0.0, 0.0>
tovector("<1,1,1>") -- <1.0, 1.0, 1.0>
tovector("<0xFF,0Xff,0xFF>") -- <255.0, 255.0, 255.0>
Expected behavior
tovector("cake") -- nil
tovector("<0,0,as>") -- nil
tovector("<0,0,0") -- nil
tovector("<0,0,0>") -- <0.0, 0.0, 0.0>
tovector("<1,1,1>") -- <1.0, 1.0, 1.0>
tovector("<0xFF,0Xff,0xFF>") -- <255.0, 255.0, 255.0>