"the fix"

This commit is contained in:
the me 2022-08-16 22:05:33 -07:00
parent aa747e8305
commit 926ae79f2a
1 changed files with 4 additions and 4 deletions

View File

@ -3,8 +3,8 @@ if select && selectedunit == noone {
var mousex = floor(mouse_x/global.tilesize.x); var mousex = floor(mouse_x/global.tilesize.x);
var mousey = floor(mouse_y/global.tilesize.y); var mousey = floor(mouse_y/global.tilesize.y);
log(mousex, mousey); log(mousex, mousey);
if mousex < array_length(global.map) { if mousex < array_length(global.map) && mousex >= 0 {
if mousey < array_length(global.map[mousex]) { if mousey < array_length(global.map[mousex]) && mousey >= 0 {
var i; var i;
for (i=0; i<array_length(global.map[mousex][mousey].contents); i++) { for (i=0; i<array_length(global.map[mousex][mousey].contents); i++) {
if global.map[mousex][mousey].contents[i].object_index == o_unit { if global.map[mousex][mousey].contents[i].object_index == o_unit {
@ -31,8 +31,8 @@ var mousex = floor(mouse_x/global.tilesize.x);
var mousey = floor(mouse_y/global.tilesize.y); var mousey = floor(mouse_y/global.tilesize.y);
//log(mousex, mousey); //log(mousex, mousey);
hoveredunit = selectedunit; hoveredunit = selectedunit;
if mousex < array_length(global.map) { if mousex < array_length(global.map) && mousex >= 0 {
if mousey < array_length(global.map[mousex]) { if mousey < array_length(global.map[mousex]) && mousey >= 0 {
var i; var i;
for (i=0; i<array_length(global.map[mousex][mousey].contents); i++) { for (i=0; i<array_length(global.map[mousex][mousey].contents); i++) {
if global.map[mousex][mousey].contents[i].object_index == o_unit { if global.map[mousex][mousey].contents[i].object_index == o_unit {