Skip to content

Commit

Permalink
Allow negative points for flags and control points
Browse files Browse the repository at this point in the history
Signed-off-by: Ruediger <[email protected]>
  • Loading branch information
RuedigerLP authored May 19, 2021
1 parent d5aac56 commit 5bfbfb4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ public boolean isPermanent() {
}

public boolean affectsScore() {
return this.pointsPerSecond > 0;
return this.pointsPerSecond != 0;
}

public float getPointsPerSecond() {
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/tc/oc/pgm/flag/state/Carried.java
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ public void tickRunning() {
}

ScoreMatchModule smm = this.flag.getMatch().getModule(ScoreMatchModule.class);
if (smm != null && this.flag.getDefinition().getPointsPerSecond() > 0) {
if (smm != null && this.flag.getDefinition().getPointsPerSecond() != 0) {
smm.incrementScore(
this.getBeneficiary(this.flag.getDefinition().getOwner()),
this.flag.getDefinition().getPointsPerSecond() / 20D);
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/tc/oc/pgm/flag/state/Returned.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public void tickRunning() {
super.tickRunning();

ScoreMatchModule smm = this.flag.getMatch().getModule(ScoreMatchModule.class);
if (smm != null && this.post.getOwner() != null && this.post.getPointsPerSecond() > 0) {
if (smm != null && this.post.getOwner() != null && this.post.getPointsPerSecond() != 0) {
smm.incrementScore(
this.flag.getMatch().needModule(TeamMatchModule.class).getTeam(this.post.getOwner()),
this.post.getPointsPerSecond() / 20D);
Expand Down

0 comments on commit 5bfbfb4

Please sign in to comment.