Hi,
I'm a newbie with basic JavaScript skills and had a weird issue in my latest room/spawn:
I tried to be 'clever' and write a module which stores all possible targets for creep actions in an object once, instead of repeatedly finding targets for each creep. So far so good. Requiring the targets module in the main module and passing the targets object as an argument to the run functions of the creep roles seemed to work at first.
But then I noticed my creeps stopping in their tracks and restarting randomly. Sometimes they stayed idle until they expired.
E.g. my 'worker' creeps would normally build construction sites if there are any and upgrade the controller the rest of the time. But the room's construction sites in the targets object/module didn't seem to update properly.
I could get the creeps to 'restart' by manually saving my script.
What causes this? The targets object should be updated with each tick. No state needs to be maintained which could be lost...
Could this be because of code caching at the back-end?
I don't see this as a bug and will rewrite my code to work around this. But I'm curious what caused this issue.
Thanks!
mar