vishal2241 / opentestbed

Automatically exported from code.google.com/p/opentestbed
0 stars 0 forks source link

when All-in sum is a little more then amount to call, other players should't call this difference #30

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Player 1 (1$)
Player 2 (2$)
Player 3 (2$)

p1 small blind 0.1$ (0.1$ , 0$, 0$)
p2 big blind 0.2$ (0.1$, 0,2$,0$)
p3 call 0.2$ (0.1$, 0,2$, 0,2$)

p1 calls 0.1 (0.2$, 0,2$, 0,2$)
p2 raises 0.6$ (0.2$, 0.8$, 0,2$)
p3 calls 0.6$ (0.2$, 0.8$, 0,8$)

p1 goes all-in (1$, 0,8$, 0.8$) (p1 calls 0.6$ and bets 0.2$ (but this is' not 
raise (sum is to small) so it's all in, but other still should call 0.2 $), but 
in opentestbed next stage is occurred without calls from other.

PublicGameInfo.java

public void update(Action act, int s) {
...
if (act.isAllInPass()) {
+ if (getPlayer(s).getBankRoll() > getAmountToCall(s)) {
+     this.lastToAct = previousActivePlayer(s);
+     this.lastAggressor = s;
+     numRaises++;
+ }
- potManager.addToPot(s, act.getAmount());
+ potManager.addToPot(s, getPlayer(s).getBankRoll()); // this variant works for 
me better, because act.getAmount() returns 0 when bot returns 
Action.allInPassAction()
getPlayer(s).update(act);
this.toAct = nextActivePlayerNotAllIn(getCurrentPlayerSeat());

}
..

Original issue reported on code.google.com by mihano...@gmail.com on 6 Nov 2010 at 11:30

GoogleCodeExporter commented 8 years ago
Hi Mihanovik, 

thanks for providing the patch. I tried to reproduce your scenario first with a 
JUnit-Test (see DealerTest.testIssue30), unfortunately I cannot reproduce this 
issue.
p2 + p3 are asked for their actions after the all-in of p1 and are both able to 
call 0.2.

So just like it should be.

Right now I won't include your patch because everything looks allright, but 
maybe you can put up another scenario, where your patch is needed ?

Original comment by bluegasp...@gmail.com on 13 Nov 2010 at 10:25

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Close this issue. Those are my own mistakes. Just cloned fresh opentesbed 
version and all works well. Sorry for that :)

Original comment by mihano...@gmail.com on 14 Nov 2010 at 1:36

GoogleCodeExporter commented 8 years ago

Original comment by bluegasp...@gmail.com on 14 Nov 2010 at 10:10