Undefined ticksToLive
-
Hi,
Since last update, in Steam's private server, creep.ticksToLive is undefined during the first tick after the creep spawns.
This problem does not happen in the online server (and did not happen in the private server previously).
Code example :
On Steam's private server :
spawn.spawnCreep([WORK,CARRY,MOVE,MOVE], 'TEST'); if (!Game.creeps['TEST'].spawning) console.log('TEST ticksToLive : '+Game.creeps['TEST'].ticksToLive); [00:21:20]TEST ticksToLive : undefined [00:21:21]TEST ticksToLive : 1499 [00:21:22]TEST ticksToLive : 1498 [00:21:23]TEST ticksToLive : 1497 [00:21:24]TEST ticksToLive : 1496 [00:21:25]TEST ticksToLive : 1495 [00:21:26]TEST ticksToLive : 1494 [00:21:27]TEST ticksToLive : 1493Same code in the online official server :
[00:27:30][shard3]TEST ticksToLive : 1499 [00:27:33][shard3]TEST ticksToLive : 1498 [00:27:36][shard3]TEST ticksToLive : 1497 [00:27:39][shard3]TEST ticksToLive : 1496 [00:27:42][shard3]TEST ticksToLive : 1495
-
Not this one again.
- https://screeps.com/forum/topic/443/creep-spawning-is-not-updated-correctly-after-spawn-process
- https://github.com/bencbartlett/Overmind/blob/5eca49a0d988a1f810a11b9c73d4d8961efca889/src/overlords/Overlord.ts#L269-L271
@artch, I thought this bug had been fixed?
-
I think
ticksToLiveis always undefined while the creep is spawning. Print out thespawningproperty at each tick along with theticksToLive
-
@deft-code My code example starts with if (!Game.creeps['TEST'].spawning)
-
Hasn't that always been the case? I found my commit where I added
ticksToLive === undefined ? CREEP_LIFE_TIME : ticksToLiveto my bot (exactly because it's undefined on the first tick) and it's from September 2017.