the ada refactor/java virus can mean a player owns resonators of a higher level than himself. make sure we don't end up with negative values in this case

fix #322
This commit is contained in:
Jon Atkins 2013-05-27 01:56:26 +01:00
parent 5c9fdc6f61
commit 895671d860

View File

@ -79,10 +79,13 @@ window.getAttackApGain = function(d) {
if(!reso) if(!reso)
return true; return true;
resoCount += 1; resoCount += 1;
var reslevel=parseInt(reso.level);
if(reso.ownerGuid === PLAYER.guid) { if(reso.ownerGuid === PLAYER.guid) {
maxResonators[parseInt(reso.level)] -= 1; if(maxResonators[reslevel] > 0) {
maxResonators[reslevel] -= 1;
}
} else { } else {
curResonators[parseInt(reso.level)] += 1; curResonators[reslevel] += 1;
} }
}); });