Made role base actually do default when variable undefined, previously spawns were not spawning

This commit is contained in:
ObeseTermite 2025-06-05 19:36:38 -07:00
parent 032cad4e24
commit bd6631781d

View file

@ -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}
});
}