Whitespace unexpectedly breaks string-to-vector, string-to-rot typecasts
tracked
Lou Netizen
vector v = (vector)"<1, 1, 1>";
llOwnerSay((string)v);
RESULT:
<1.00000, 1.00000, 1.00000>
vector v = (vector)"<1 , 1 , 1>"; // note the extra space
llOwnerSay((string)v);
RESULT:
<0.00000, 0.00000, 0.00000>
EXPECT:
<1.00000, 1.00000, 1.00000>
NOTE: Similar results with
" <1, 2, 3>"
(leading space); however, "<1, 2, 3> "
(trailing space), "< 1, 2, 3>"
and "<1, 2, 3 >"
work as expected.Same thing happens typecasting rotations with whitespace before a comma.
I can't think of any reason that whitespace character would be significant and invalidate conversion of the initial string to a vector or rotation. One would think the typecast would be fairly liberal about accepting text representations of vectors and rotations.
Log In
Maestro Linden
tracked
Bleuhazenfurfle Resident
Gah. Yes. Please fix this.
I was going to write this one up ages ago, but got distracted by crashy NaN's, that disappeared on the next sim restart.
You can also shove all sorts of stuff after that last term, and it just ignores it — though I don't see that as a problem like that whitespace is.