Made role base actually do default when variable undefined, previously spawns were not spawning
This commit is contained in:
parent
032cad4e24
commit
bd6631781d
|
@ -4,10 +4,9 @@ var name = 'Creep';
|
|||
function run(creep) { }
|
||||
|
||||
function spawn(spawnPoint, newBody, newName){
|
||||
if(newBody === 'undefined') newBody = body;
|
||||
if(newName === 'undefined') newName = name;
|
||||
|
||||
spawnPoint.spawnCreep(newBody, newName + Game.time,
|
||||
if(typeof newBody === 'undefined') newBody = body;
|
||||
if(typeof newName === 'undefined') newName = name;
|
||||
spawnPoint.spawnCreep(newBody, newName + Game.time,
|
||||
{memory : {role : newName}
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue