Page 1 of 1

SalaryAverage not always correct in sim/XML

Posted: Mon Jul 24, 2017 1:57 pm
by SICHLCommish
I recently upgraded from ver. 2 to ver. 3 and noticed that the "Salary" field in the XML output has changed to an array. Since in our league every year of a contract is always the same salary, for my purposes I figured I could use the SalaryAverage field instead.

But I ran into a problem. The SalaryAverage field is sometimes (actually quite often) wrong.

Here's an example from my data (a player with a 2-year, $900,000 contract... but the average is listed $894,000):

Code: Select all

<Contract>2</Contract>
    <Rookie>false</Rookie>
    <PProtected>false</PProtected>
    <NoApplyRerate>false</NoApplyRerate>
    <AvailableforTrade>false</AvailableforTrade>
    <NoTrade>false</NoTrade>
    <CanPlayPro>true</CanPlayPro>
    <CanPlayFarm>true</CanPlayFarm>
    <ForceWaiver>false</ForceWaiver>
    <StarPower>0</StarPower>
    <Salary>
      <unsignedInt>0</unsignedInt>
      <unsignedInt>900000</unsignedInt>
      <unsignedInt>900000</unsignedInt>
      <unsignedInt>0</unsignedInt>
      <unsignedInt>0</unsignedInt>
      <unsignedInt>0</unsignedInt>
      <unsignedInt>0</unsignedInt>
      <unsignedInt>0</unsignedInt>
      <unsignedInt>0</unsignedInt>
      <unsignedInt>0</unsignedInt>
      <unsignedInt>0</unsignedInt>
    </Salary>
    <SalaryAverage>894000</SalaryAverage>

This bug does not affect all players, but it was a significant number of them.

I have since changed my code to read the second item in the Salary array, as that appears to be the first year of the contract. So I am fine, but I thought I should bring this bug to your attention.

Re: SalaryAverage not always correct in sim/XML

Posted: Mon Jul 24, 2017 7:57 pm
by SimonT
Hi.

The Salary Average can be different from salary for player. If you think it's incorrect, you can recalculate all players salary average with the "Calculate All Players Salary Average" manuel command. If all your players have the same salary for all there contract year, it should give you the same number.

Re: SalaryAverage not always correct in sim/XML

Posted: Tue Jul 25, 2017 10:54 am
by SICHLCommish
This seems to have worked. I spot checked a couple of players who had incorrect averages before and they are correct now.