diff GUIWindow.cpp @ 2472:e42e01ff1526

goto cleaning
author zipi
date Mon, 18 Aug 2014 18:17:20 +0100
parents 8516bb27d7f0
children 0a0c6d75aabe
line wrap: on
line diff
--- a/GUIWindow.cpp	Mon Aug 18 22:24:00 2014 +0600
+++ b/GUIWindow.cpp	Mon Aug 18 18:17:20 2014 +0100
@@ -2903,7 +2903,8 @@
 			current_npc_text = BuildDialogueString(current_npc_text, uActiveCharacter - 1, 0, 0, 0, 0);
 			NPCHireableDialogPrepare();
 			dialogue_show_profession_details = false;
-			goto _return;
+			BackToHouseMenu();
+			return;		
 		case 19:
 			pEventNumber = pCurrentNPCInfo->evt_A;
 			break;
@@ -2923,7 +2924,8 @@
 			pEventNumber = pCurrentNPCInfo->evt_F;
 			break;
 		default:
-			goto _return;
+			BackToHouseMenu();
+			return;
 		}
 		/*switch ( pEventNumber )
 		{
@@ -2967,7 +2969,8 @@
 		{
 			_4B3FE5_training_dialogue(pEventNumber);
 		}
-		goto _return;
+		BackToHouseMenu();
+		return;
 	}
 	if (uMessageParam != 76)
 	{
@@ -3078,18 +3081,23 @@
 					if (uActiveCharacter)
 					{
 						pPlayers[uActiveCharacter]->PlaySound((PlayerSpeech)SPEECH_86, 0);
-						goto _return;
+						BackToHouseMenu();
+						return;
 					}
 				}
 			}
 		}
-		goto _return;
+		BackToHouseMenu();
+		return;
 	}
 	if (pParty->pHirelings[0].pName && pParty->pHirelings[1].pName)
 	{
 		ShowStatusBarString(pGlobalTXT_LocalizationStrings[533], 2);// ""I cannot join you, you're party is full""
-		goto _return;
+		BackToHouseMenu();
+		return;
 	}
+	
+	
 	if (pCurrentNPCInfo->uProfession != 51) //burglars have no hiring price
 	{
 		__debugbreak();  // probably hirelings found in buildings, not present in MM7, changed "pCurrentNPCInfo->uProfession - 1" to "pCurrentNPCInfo->uProfession", have to check in other versions whether it's ok
@@ -3104,9 +3112,11 @@
 			if (uActiveCharacter)
 				pPlayers[uActiveCharacter]->PlaySound(SPEECH_NotEnoughGold, 0);
 			ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2);
-			goto _return;
+			BackToHouseMenu();
+			return;
 		}
-		Party::TakeGold(pPrice);
+		else
+			Party::TakeGold(pPrice);
 	}
 	//LOBYTE(v2->uFlags) |= 0x80u;
 	pCurrentNPCInfo->uFlags |= 128;
@@ -3140,6 +3150,7 @@
 	}*/
 	if (uActiveCharacter)
 		pPlayers[uActiveCharacter]->PlaySound((PlayerSpeech)61, 0);
+
 _return:
 	BackToHouseMenu();
 }