Two same objects show different result



  • @mrfaul no it doesn't work )))))))))))))))) https://pastebin.com/AgCJZ4y6



  • Sorry for the late answser I was busy

    hmm indeed I see nothing in there why it shouldn't work, but I have a idea why it could be buggy:
    You only set the roles quantity to "0" but that doesn't guaranties that there are no wild "undefined" variables when you loop through your creeps.

    Try this:

    for (const i in Game.creeps) {
            const creep = Game.creeps[i];
            let currentQuantity = roles[creep.memory.spawnRoom][creep.memory.role].currentQuantity || 0; // use the saved variable or "0"
            ++currentQuantity; // increment
            roles[creep.memory.spawnRoom][creep.memory.role].currentQuantity = currentQuantity; // save
    
            if (creep.memory.spawnRoom === 'E59S58' && creep.memory.role === 'upgrader') {
                 console.log(roles['E59S58']['upgrader'].currentQuantity)
            }
        }
    

    Using this method you can also get rid of the additional for loop that only sets it to zero.
    One thing less that takes up time.



  • @kepamuk @o4kapuk jo apparently the last picture:

    http://dl4.joxi.net/drive/2020/01/31/0011/2711/772759/59/69625b05ca.jpg

    Is contaminated with some malicious software and got flagged by our GData Enterprise Suite... So it could be that the host server or your private machine is compromised pls check that.

    Update: Or GData is just beeing GData 😑 since I double checked it and only 2 out of 73 scanner flagged it.
    Man that software is annoying, but better than nothing. At least it is doing it's job... sorta.