SalaryAverage not always correct in sim/XML

Any questions related to version 2 or version 3 should be ask here. / Toutes les questions sur la version 2 ou la version 3 devraient être demandées ici.
Post Reply
SICHLCommish
The Accomplished One / L'Accompli
Posts: 87
Joined: Mon Sep 15, 2008 3:37 pm
Location: Toronto
Contact:

SalaryAverage not always correct in sim/XML

Post 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.
SimonT
STHS Owner / Propriétaire du STHS
Posts: 14755
Joined: Sat Oct 08, 2005 4:18 pm
Location: Montreal, Canada
Contact:

Re: SalaryAverage not always correct in sim/XML

Post 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.
-SimonT
Forum Administrator / Administrateur du Forum
STHS Owner / Propriètaire du STHS
English V2 & V3 Manual - Manuel V2 & V3 Français
SICHLCommish
The Accomplished One / L'Accompli
Posts: 87
Joined: Mon Sep 15, 2008 3:37 pm
Location: Toronto
Contact:

Re: SalaryAverage not always correct in sim/XML

Post by SICHLCommish »

This seems to have worked. I spot checked a couple of players who had incorrect averages before and they are correct now.
Post Reply