Advertisement
Guest User

Untitled

a guest
May 24th, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Object.defineProperty(Creep.prototype, 'run', {
  2.   value: function() {
  3.     if (this.nextRun > Game.time || !this.task) return OK;
  4.  
  5.     try {
  6.       let task = require('class.task.' + this.task);
  7.       return task.run(this);
  8.     }
  9.     catch (e) {
  10.       // unknown module/task
  11.       logger.error(`Invalid task "${this.task}" for creep ${this.name}`);
  12.       return ERR_INVALID_ARGS;
  13.     }
  14.   },
  15.   configurable: true,
  16.   enumerable: false,
  17. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement