Skip to content

Commit

Permalink
Offer popup bug fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
aybarsaltinisik committed Dec 20, 2020
1 parent da6f341 commit 855f3bb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/models/Agreement.java
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,9 @@ public Player getFirstPlayer(){
return firstPlayer;
}

// get second player
public Player getSecondPlayer() { return secondPlayer; }

// get id
public String getName() { return name; }

Expand Down
2 changes: 1 addition & 1 deletion src/models/Game.java
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public int getPlayerNumber(){

public Agreement offerAgreement(){
for(Agreement agreement: agreements){
if(!agreement.isOffered()){
if(!agreement.isOffered() && (agreement.getSecondPlayer().getId() == currentPlayer)){
return agreement;
}
}
Expand Down

0 comments on commit 855f3bb

Please sign in to comment.