{} 로 둘러 싸 주면 오류 안날거네요
int 선언이 잇어서 그런듯,,,
case 0:
{
int landHost = squares[i1].host;
int pay = squares[i1].money/5;
if(landHost==1){
ShowMessage("It's your land!");
}
else {
if(squares[i1].hasHotel==1){
pay*=2;
ShowMessage("This land has a hotel!");
}
ShowMessage("Paid "+IntToStr(pay)+"W to Player "+landHost+"!");
money[0]-=pay;
money[landHost-1]+=pay;
if(money[0]<=0){
ShowMessage("You Lost!");
Form1->Close();
}
}
RollBtn->Visible=true;
}
break;
심재민 님이 쓰신 글 :
: RollBtn->Visible=false;
: int dice=Roll();
: ShowMessage("You got "+IntToStr(dice)+"!");
: i1+=dice;
: if(i1>=44){
: ShowMessage("Here's your salary!");
: money[0]+=1000000;
: i1=i1%44;
: }
: P1->Left=squares[i1].pos.x;
: P1->Top=squares[i1].pos.y;
: int boardtype=squares[i1].type;
: switch(boardtype){
: case 0:
: int landHost = squares[i1].host;
: int pay = squares[i1].money/5;
: if(landHost==1){
: ShowMessage("It's your land!");
: }
: else {
: if(squares[i1].hasHotel==1){
: pay*=2;
: ShowMessage("This land has a hotel!");
: }
: ShowMessage("Paid "+IntToStr(pay)+"W to Player "+landHost+"!");
: money[0]-=pay;
: money[landHost-1]+=pay;
: if(money[0]<=0){
: ShowMessage("You Lost!");
: Form1->Close();
: }
: }
: RollBtn->Visible=true;
: break;
: case 1:
: ShowMessage("This land is empty with money "+IntToStr(squares[i1].money)+"W.");
: BuyGroup->Visible=true;
: break;
: case 2:
: //Chance code needed
: RollBtn->Visible=true;
: break;
: case 3:
: //vertex code needed
: RollBtn->Visible=true;
: break;
: default:
: RollBtn->Visible=true;
: break;
: }
:
: 여기서 각각 case 1, case 2, case 3, default 에 대해서 cannot jump from switch statement to this case label 이라고 뜨네요
|