Results 1 to 3 of 3

Thread: Clash API BUG with Destruction calculation

  1. #1

    Clash API BUG with Destruction calculation

    The way destruction gets caluclated in the api with clanwarleagues/wars/{warTag} call is incorrect.


    Take this war for example:
    https://api.clashofclans.com/v1/clan...s/%23292LV8GUR
    There are 3 components to keep in mind:

    eligible_members (eg. 21): Number of members who are eligible to participate in the clans' CWL (all members in queue)
    total_destruction(eg. 978): The sum of the max destruction done to the opponent clan (if a base is attacked twice, take the max destruction)
    members_in_war (eg. 15) = 15 or 30 (depending on your war size)


    The correct way to calculate the destruction as reported in-game is:
    destruction % = total_destruction/members_in_war (in this case 978/15 = 65.2%)

    The incorrect way (the way the API does it):
    destruction % = total_destruction/eligible_members(in this case 978/21 = 46.5714%)


    Please let me know if you agree with me and if you're seeing similar issues.

  2. #2

    Join Date
    Sep 2014
    Location
    Digging another tunnel in the data mine
    Posts
    6,583
    Yes, i calculate the destruction myself by counting up the best attacks
    Various data posts: Who plays what? CWL data 1 (stars), 2 (3* rates), 3 (rosters), 4 (start times and other) Data at end of old Legends And (non-data) how max bases are ordered in war
    --------------------
    Forum cup organiser. The forum cup discord server is: https://discord.gg/KEUxV2e

  3. #3
    That sounds like a workaround for an issue that should be dealt with by SC. They make over a million bucks a day and canít fix bugs in the API. Sad

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •