#resmax[resAdvance] is calculated in a script on the resAdvance pick itself, at Setup/2000.
You should have a script at setup/2010 that re-calculates the XP/advances, and then sets #resmax[resAdvances] = the number it calculated. Having to add to both resLeft and resMax in a script is a kludge. Even if you're not fixing it in your own code, I'd appreciate it if you could fix it in the code examples thread - if you're posting examples for everyone to learn from, those examples should be well-constructed examples.
You should have a script at setup/2010 that re-calculates the XP/advances, and then sets #resmax[resAdvances] = the number it calculated. Having to add to both resLeft and resMax in a script is a kludge. Even if you're not fixing it in your own code, I'd appreciate it if you could fix it in the code examples thread - if you're posting examples for everyone to learn from, those examples should be well-constructed examples.