PapaCharlie9 / multi-balancer

BF3 & BF4 multiple mode balancer & unstacker, including SQDM.
9 stars 12 forks source link

Refactor and fix logging of ToTeamByDispersal #89

Open PapaCharlie9 opened 10 years ago

PapaCharlie9 commented 10 years ago

Each of the three cases where dispersal is calculated should be refactored into a separate function, so that the goto's can be removed.

Also, the log lines needs to fixed so that the current player is not removed from the count. For example, for rank dispersal:

        String a = rankers[1] + "/" + rankers[2];
        if (isSQDM) a = a + "/" + rankers[3] + "/" + rankers[4];
        DebugWrite("^9(DEBUG) ToTeamByDispersal: analysis of ^b" + name + "^n dispersal of rank >= " + perMode.DisperseEvenlyByRank + ": " + a, 5);

Since this log line happens before rankers is used to select the target team, the log line would have to be moved after and the player added back to the team count they belong to before the string is constructed, something like:

         int pTeam = ... get players's team ...;
         rankers[pTeam] += 1;