mainIine / foe-helfer-extension

FoE Helfer - Extension for chromium based browsers and Firefox ;-)
https://foe-helper.com
GNU Affero General Public License v3.0
119 stars 181 forks source link

Statistics messed in guild memeber stat on Guild Buildigs page #2751

Open masolodkov opened 4 months ago

masolodkov commented 4 months ago

In the detailed view on the Guild Buildings page, the statistics were incorrect. For example, in the summary, I could see 76 arcs in the guild, but in the detailed view, there were only 60 members with arcs.

After a little investigation, the problem was locally fixed by changing one line of code in guildmemberstat.js:

Original source code (in ShowGuildBuildings):

let buildingID = helper.str.cleanup(obj.member) + '' + obj.gbid;

Fixed line:

let buildingID = `${obj.player_id}-${obj.gbid}`;

After this change, everything worked fine.

If you could incorporate this fix into the main code, we would be grateful. :)

PS: to be more informative about this bug - for some members helper.str.cleanup(obj.member) return empty string, so buildingId became not unique. While player_id is fine for all cases.