Removed C99 dynamic arrays for MSVC compatibility.
This commit is contained in:
@@ -46,7 +46,7 @@ LocalHand::LocalHand(EngineFactory *f, GuiInterface *g, BoardInterface *b, Playe
|
||||
|
||||
// Karten generieren und Board sowie Player zuweisen
|
||||
Tools myTool;
|
||||
int cardsArray[2*actualQuantityPlayers+5];
|
||||
int *cardsArray = new int[2*actualQuantityPlayers+5];
|
||||
myTool.getRandNumber(0, 51, 2*actualQuantityPlayers+5, cardsArray, 1);
|
||||
int tempBoardArray[5];
|
||||
int tempPlayerArray[2];
|
||||
@@ -78,7 +78,8 @@ LocalHand::LocalHand(EngineFactory *f, GuiInterface *g, BoardInterface *b, Playe
|
||||
|
||||
//Rundenwechsel | beim ersten Durchlauf --> Preflop starten
|
||||
myGui->nextPlayerAnimation();
|
||||
|
||||
|
||||
delete[] cardsArray;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -182,7 +182,7 @@ void LocalRiver::distributePot() {
|
||||
int winnersCounter = 0;
|
||||
|
||||
// dieses Array ermittelt wieviel jeder Spieler wᅵrend der gesamten BettingRound gesetzt hat
|
||||
int roundSetArray[myHand->getGuiInterface()->getMaxQuantityPlayers()];
|
||||
int *roundSetArray = new int[myHand->getGuiInterface()->getMaxQuantityPlayers()];
|
||||
for(i=0; i<myHand->getGuiInterface()->getMaxQuantityPlayers(); i++) {
|
||||
// Standardwert fr nicht mehr aktive
|
||||
roundSetArray[i] = 0;
|
||||
@@ -193,7 +193,7 @@ void LocalRiver::distributePot() {
|
||||
}
|
||||
|
||||
// hier steht der CardsValue der Spieler drin die an der Potverteilung teilnehmen (d.h. aktiv und nicht gefoldet), bei allen anderen steht ne 0
|
||||
int cardsValueArray[myHand->getGuiInterface()->getMaxQuantityPlayers()];
|
||||
int *cardsValueArray = new int[myHand->getGuiInterface()->getMaxQuantityPlayers()];
|
||||
int playerWantsPotCounter = 0;
|
||||
|
||||
for(i=0; i<myHand->getGuiInterface()->getMaxQuantityPlayers(); i++) {
|
||||
@@ -421,5 +421,6 @@ void LocalRiver::distributePot() {
|
||||
if(myHand->getBoard()->getPot() != 0) cout << "!!! Pot: " << myHand->getBoard()->getPot() << endl;
|
||||
|
||||
delete[] winnersArray;
|
||||
|
||||
delete[] roundSetArray;
|
||||
delete[] cardsValueArray;
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ void Tools::getRandNumber(int start, int end, int howMany, int* randArray, bool
|
||||
else {
|
||||
|
||||
|
||||
int tempArray[end-start];
|
||||
int *tempArray = new int[end-start];
|
||||
int i;
|
||||
for (i=0; i<(end-start); i++) tempArray[i]=1;
|
||||
|
||||
@@ -67,6 +67,7 @@ void Tools::getRandNumber(int start, int end, int howMany, int* randArray, bool
|
||||
|
||||
}
|
||||
|
||||
delete[] tempArray;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user