Game.structures does not include links



  • To reproduce:

    var obj = []; _.each(Game.structures, function(e) {obj.push(e.structureType)}); JSON.stringify(obj)
    

    (or wrapped in a function, but otherwise identical code)

    (function() {var obj = []; _.each(Game.structures, function(e) {obj.push(e.structureType)}); return JSON.stringify(obj)})()
    

    It should list the type of each object. But currently this list is missing link objects.



  • Can confirm.

    var tstLinks = _.filter(_.values(Game.structures), function (e) {
            return e.structureType == STRUCTURE_LINK;
        });
    
    console.log("TSTLINKS: ", tstLinks.length); // is 0 :(
    

  • Dev Team

    Thanks for reporting, fixed.


  • Dev Team

    By the way, lodash filter supports more simple syntax:

    var tstLinks = _.filter(Game.structures, {structureType: STRUCTURE_LINK});
    


  • Thans @Artem for fix and for cleaner filter expression.