@screeps/engine
Version:
This is a module for Screeps standalone server. See [main repository](https://github.com/screeps/screeps) for more info.
16 lines (13 loc) • 595 B
JavaScript
;
var _ = require('lodash'),
utils = require('../../../utils'),
driver = utils.getDriver(),
C = driver.constants;
module.exports = function (spawn, intent, { roomObjects, bulk }) {
if (spawn.type != 'spawn' || !spawn.spawning) return;
var spawningCreep = _.find(roomObjects, { type: 'creep', name: spawn.spawning.name, x: spawn.x, y: spawn.y });
bulk.remove(spawningCreep._id);
delete roomObjects[spawningCreep._id];
bulk.update(spawn, { spawning: null });
};
//# sourceMappingURL=../../../sourcemaps/processor/intents/spawns/cancel-spawning.js.map