Could you try to replace line 128 with the following codes? IF((X MOD 16)>=12 || (X MOD 16)<4)&&((Y MOD 16)>=12 || (Y MOD 16)<4)THEN