rnd = random(400) - 200;
terrainStruct.x = rnd;
The problem is:
rnd = -59;
terrainStruct.x = 64xxx; (or 65xxx?)
rnd is a var, terrainStruct.x is a "short" (also tried "signed short"), but the short overflows (right term?)...
Anyone got any ideas?
EDIT:
I just noticed that the manual shows short range as "0 to 65535", I guess its always unsigned.
I'll try to unsign my pos (subtracting) and store it, then sign upon retrieval, but I've got to find the exact middle value, I guess...