"moveByPath" wrong direction
-
I have an strange issue, my creep does not walk to the end of the path but to the beginning when moving by path.
if (creep.carry.energy >= 1) {
//go to hive and drop
var home = flag.memory.homePath;
var hive = Game.spawns[flag.memory.hive];
creep.moveByPath(home);
creep.transferEnergy(hive);
} else {
//go to flag and wait
var work = flag.memory.workPath;
var err = creep.moveByPath(work);
console.log(err);
}I checked the memory, homePath and workPath are set right, he starts the process with no energy, at the end of the workPath, so he should not move, but he walks back to the hive with no reason. If i change the both pathes just to check if he always moves backwads, than he doesnt move as well. And i don't get an error from the moveByPath funktion
-
Ok well sry i got it, reversing the array is not enough, I have to reverse the directions as well . . .