spawning is false, but ticksToLive is undefined


  • Culture

    Tonight I found a duplicate-spawn bug in my code.

    I've had this bug for a while, it seems, but it's much more obvious when I'm trying to spawn just one thing. So I tracked it down.

    It turns out that on the tick that spawning is completed, `spawning` becomes false, but `ticksToLive` is still `undefined`.

    I was checking ttl against a value OR if it's spawning, and thus ending up with some extra spawns.

    Who knows how much energy I've wasted over the months 😛

    Anyway, that should probably be fixed.