Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Object.defineProperty(Creep.prototype, 'run', {
- value: function() {
- if (this.nextRun > Game.time || !this.task) return OK;
- try {
- let task = require('class.task.' + this.task);
- return task.run(this);
- }
- catch (e) {
- // unknown module/task
- logger.error(`Invalid task "${this.task}" for creep ${this.name}`);
- return ERR_INVALID_ARGS;
- }
- },
- configurable: true,
- enumerable: false,
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement