15 lines
528 B
Plaintext
15 lines
528 B
Plaintext
function c_moveunit(targetunit, destination) {
|
|
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);
|
|
/*if !*/array_remove(theguy.contents, targetunit) //idhfnjg();
|
|
//theguy.contents = [];
|
|
//destination.contents = [];
|
|
array_push(destination.contents, targetunit);
|
|
targetunit.pos.x = destination.x;
|
|
targetunit.pos.y = destination.y;
|
|
destination.event(targetunit);
|
|
} |