Screeps Crashing ?



  • //main.js:
    var queue = require('spawn.queue');

    module.exports.loop = function ()
    {
        queue.addCreep('Hello World !', 2);
        console.log(queue.checkCreep);
    };

    //queue.js:
    var spawnQueue = [];

    module.exports =
    {
        addCreep: function(creep, number)
        {
            for (;number > 0; number++)
            {
                spawnQueue.push(creep);
            }
        },
        
        spawnCreep: function(creep, number)
        {
            for (;number > 0; number++)
            {
                spawnQueue.unshift(creep);
            }
        },
        
        checkCreep: function()
        {
            return (spawnQueue[0]);
        },
        
        getCreep: function()
        {
            return (spawnQueue.shift());
        }
    };


    So. In simulation, this is making the game crash. idk where to start. x)

    Can someone pls help me ? ^^



  • infinite loop? did you mean number-- in both for loops?

    for (;number > 0; number++)


  • Oh. yeah. right. x)
    Thanks a lot ^^'