Code:
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? laugh


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

Last edited by EpsiloN; 12/23/15 09:27.

Extensive Multiplayer tutorial:
http://mesetts.com/index.php?page=201