Quote:
Originally posted by DarkShadows_Legend
It doesn't seem to work for me.
|
|| is a boolean thing, so it only returns true or false.
'var == (1||3)' would check wether var is true, as '(1||3)' returns true because neither 1 or 3 is false.
Not sure wether it is exactly like that in GScript, but in theory it should be like that.
Probably one could also save some lines
by using vecx/y.
NPC Code:
if (playerdir == 0) playery --;
else if (playerdir == 1) playerx --;
else if (playerdir == 2) playery ++;
else if (playerdir == 3) playerx ++;
is inferior to
NPC Code:
playerx += vecx(playerdir);
playery += vecy(playerdir);