diff --git a/FightSystem_Main/src/de/steamwar/fightsystem/winconditions/WinconditionPoints.java b/FightSystem_Main/src/de/steamwar/fightsystem/winconditions/WinconditionPoints.java index b661148..84959d4 100644 --- a/FightSystem_Main/src/de/steamwar/fightsystem/winconditions/WinconditionPoints.java +++ b/FightSystem_Main/src/de/steamwar/fightsystem/winconditions/WinconditionPoints.java @@ -118,17 +118,20 @@ public class WinconditionPoints extends PercentWincondition implements Listener @Override protected void enable() { super.enable(); - points = 0; - int ownBlocks = totalBlocks; - int enemyBlocks = teamMap.get(Fight.getOpposite(fightTeam)).totalBlocks; - - if(enemyBlocks == 0) + TeamPoints opponent = teamMap.get(Fight.getOpposite(fightTeam)); + if(opponent.totalBlocks == 0) return; - if(enemyBlocks < ownBlocks) { + setup(opponent.totalBlocks); + opponent.setup(totalBlocks); + } + + private void setup(int enemyBlocks){ + points = 0; + if(enemyBlocks < totalBlocks) { this.factor = 100; //Original mit 20 (20% = 0.2 ergeben 2000 Punkte } else { - double f = 100.0 * ownBlocks / enemyBlocks; + double f = 100.0 * totalBlocks / enemyBlocks; if(f > 100) f = 100; diff --git a/FightSystem_Main/src/de/steamwar/fightsystem/winconditions/WinconditionRelativeWhitelistPercent.java b/FightSystem_Main/src/de/steamwar/fightsystem/winconditions/WinconditionRelativeWhitelistPercent.java index cc48b84..b64df9c 100644 --- a/FightSystem_Main/src/de/steamwar/fightsystem/winconditions/WinconditionRelativeWhitelistPercent.java +++ b/FightSystem_Main/src/de/steamwar/fightsystem/winconditions/WinconditionRelativeWhitelistPercent.java @@ -41,5 +41,4 @@ public class WinconditionRelativeWhitelistPercent extends PercentWincondition im } }; } - }