@sandgrainone said in creep.room.name not being updated correctly:
I suspect that you have encountered the same issue with path finding as many before you. The creep bounce back and forth between rooms because the moveTo action returns "ERR_NO_PATH" the first tick in the new room.
https://screeps.com/forum/topic/1352/err_no_path-when-creep-moveto-flag-in-another-room/16
Exactly that. I had to make my screeps go to a random point in the room before attempting to path to the controller. That seems to be the only way to keep them from playing musical rooms. Will post the code below in case someone else runs into the problem and many of the alternatives don't work for them either:
if (creep.room.name != creep.room.targRm) {
// create position in the middle of target room; game was not properly reading memory so manually assigned room name
var targetPos = new RoomPosition(25, 25, 'W7N3');
creep.moveTo(targetPos);
} else {
var res = creep.claimController(creep.room.controller);
if (res == ERR_NOT_IN_RANGE) {
creep.moveTo(creep.room.controller);
} else if (res == ERR_GCL_NOT_ENOUGH) {
console.log('GCL too low');
} else {
console.log(res);
}
}