Minor bug fixes

This commit is contained in:
douwe
2025-08-13 21:08:26 +02:00
parent 9a1682a857
commit 257cf85695
9 changed files with 24 additions and 31 deletions

View File

@@ -10,16 +10,15 @@
void DouwcoHivemind::Spawn::process()
{
int creepcount = structure->room().find(Screeps::FIND_MY_CREEPS, nullptr).size();
EM_ASM({ console.log('creepcount: ' + $0); }, creepcount);
if (creepcount >= 10) return;
int creepcount = structure->room().find(Screeps::FIND_MY_CREEPS).size();
if (creepcount > 10) return;
JSON opts;
opts["memory"]["role"] = DouwcoHivemind::ROLE_HARVESTER;
int resp = structure->spawnCreep(
{"work", "carry", "move"},
"harvester" + std::to_string(creepcount + 1),
"harvester" + std::to_string(Screeps::Game.time()),
opts
);
}