Skip to content

Commit

Permalink
Make targetMoveError respect ownerExpAccWeight
Browse files Browse the repository at this point in the history
  • Loading branch information
sprunk committed Jun 19, 2014
1 parent e960e3a commit 0f59e10
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions rts/Sim/Weapons/Weapon.cpp
Expand Up @@ -1371,7 +1371,7 @@ void CWeapon::StopAttackingAllyTeam(int ally)

float CWeapon::ExperienceScale() const
{
// (1.0f - (limExperience * expAccWeight)) means accuracy increases
// (1.0f - (limExperience * expAccWeight)) means accuracy increases (lower is better)
// accWeight=1.00 --> 0.5 experience gives (1.0 - 0.500)=0.500 weighted acc
// accWeight=0.50 --> 0.5 experience gives (1.0 - 0.250)=0.750 weighted acc
// accWeight=0.25 --> 0.5 experience gives (1.0 - 0.125)=0.875 weighted acc
Expand All @@ -1381,11 +1381,7 @@ float CWeapon::ExperienceScale() const

float CWeapon::MoveErrorExperience() const
{
// 1.0f - (1.0f - (limExperience * targetMoveError)) means error decreases
// moveError=1.00 --> 0.5 experience gives 1.0 - (1.0 - 0.500)=0.500 weighted error
// moveError=0.50 --> 0.5 experience gives 1.0 - (1.0 - 0.250)=0.250 weighted error
// moveError=0.25 --> 0.5 experience gives 1.0 - (1.0 - 0.125)=0.125 weighted error
// moveError=0.00 --> 0.5 experience gives 1.0 - (1.0 - 0.000)=0.000 weighted error
return (1.0f - CUnit::ExperienceScale(owner->limExperience, weaponDef->targetMoveError));
// see above
return (CUnit::ExperienceScale(owner->limExperience, weaponDef->ownerExpAccWeight) * weaponDef->targetMoveError);
}

0 comments on commit 0f59e10

Please sign in to comment.