Ok, here is the code for the addPotion().
Code:
void addPotion( int cost, char* potionName, int hp, int pot){
if(pot == 1){
if(chr.gold > cost || chr.gold == cost){
potionLoop = 1;
while(potionLoop == 1){
cout << " Choose a potion slot: \n\n";
Sleep(1000);
if(strcmp(chr.offpotionName1, "-")==0){
cout << " -empty-\n\n";
}
else{
cout << " 1. " << chr.offpotionName1 << "\n";
}
if(strcmp(chr.offpotionName2, "-")==0){
cout << " -empty-\n\n";
}
else{
cout << " 2. " << chr.offpotionName2 << "\n";
}
if(strcmp(chr.offpotionName3, "-")==0){
cout << " -empty-\n\n";
}
else{
cout << " 3. " << chr.offpotionName3 << "\n";
}
cout << " I don't want this potion.\n\n";
cin >> slotOption;
Sleep(750);
switch(slotOption){
case 1:
chr.gold = chr.gold - cost;
chr.offpotionName1 = potionName;
chr.offpotionUsed1 = 0;
chr.offpotionHP1 = hp;
cout << "\n\n The potion " << potionName << " was successfully added to Poion Slot 1.\n\n";
Sleep(1000);
potionLoop = 0;
break;
case 2:
chr.gold = chr.gold - cost;
chr.offpotionName2 = potionName;
chr.offpotionUsed2 = 0;
chr.offpotionHP2 = hp;
cout << "\n\n The potion " << potionName << " was successfully added to Potion Slot 2.\n\n";
Sleep(1000);
potionLoop = 0;
break;
case 3:
chr.gold = chr.gold - cost;
chr.offpotionName3 = potionName;
chr.offpotionUsed3 = 0;
chr.offpotionHP3 = hp;
cout << "\n\n The potion " << potionName << " was successfully added to Potion Slot 3.\n\n";
Sleep(1000);
potionLoop = 0;
break;
case 4:
cout << " You leave the shop.\n\n";
Sleep(1500);
potionLoop = 0;
break;
default:
cout << " Something went wrong...try again.\n\n";
Sleep(1500);
}
}//End WHILE
}
else{
cout << " You don't have that much money.\n\n";
Sleep(1500);
potionLoop = 0;
}
}
}
Im not really sure what to say about the error report. ITs one of the windows ones that pops up and just says "LoC has encountered a porblem and needs to close. Sorry for your inconvenience." I dont get those often so im not really sure what else to tell you about it.