Arena: prototype of opponent construction site not available in S&S



  • I'm not completely sure if this is a bug or not. If an opponent creates a construction site in S&S, the "structure" attribute of the construction site is "undefined". This means you're not able to determine the prototype of the opponent's construction site. However you are able to obtain some info about what they're building via the progressTotal property of the construction site (e.g. 1250 => tower, 200 => rampart or extension).

    The following code was run in a replay with one player and one hostile construction site. The sit labelled "my cs:" has info, but the hostile construction site logged "cs:" is undefined.

          for (const c of cs) {
            if (c.my) {
              console.log("my cs:", c.structure, c.structure == null, c.structure === undefined);
              continue;
            }
            else {
              console.log("cs:", c.structure, c.structure == null, c.structure === undefined);
            }
    

    0_1712862947071_fca836a9-7485-4e4e-b0ac-ec4b6cb315a5-image.png