Skip to content

Instantly share code, notes, and snippets.

View Dessix's full-sized avatar
🏳️‍⚧️

Zoey Dessix

🏳️‍⚧️
  • Microsoft; Theseus Institute
  • Redmond, WA, U.S.
View GitHub Profile
Creep.prototype.findNearestStorage: function() {
var pref = undefined;
if (this.room.storage != undefined) {
pref = this.room.storage;
}
for (var link in this.room.memory.energy.linkSources) {
var l = Game.getObjectById(link);
if (l != null && this.pos.getRangeTo(pref) > this.pos.getRangeTo(l)) {
pref = l;
}