eastern-flames/eastern flames/scripts/c_moveunit/c_moveunit.gml

15 lines
528 B
Plaintext
Raw Normal View History

2022-08-16 22:28:01 +00:00
function c_moveunit(targetunit, destination) {
2022-08-23 13:06:02 +00:00
if targetunit.alignment == ARMY.US {
var theguy = c_gettile(targetunit.returnpos.x, targetunit.returnpos.y);
} else {
var theguy = c_gettile(targetunit.pos.x, targetunit.pos.y);
}
//log(theguy.contents);
2022-08-23 08:34:45 +00:00
/*if !*/array_remove(theguy.contents, targetunit) //idhfnjg();
2022-08-23 13:06:02 +00:00
//theguy.contents = [];
//destination.contents = [];
2022-08-16 22:28:01 +00:00
array_push(destination.contents, targetunit);
targetunit.pos.x = destination.x;
targetunit.pos.y = destination.y;
2022-08-23 13:06:02 +00:00
destination.event(targetunit);
2022-08-16 22:28:01 +00:00
}