diff mm7_6.cpp @ 169:d1dde383af89

Merge
author Nomad
date Thu, 14 Feb 2013 14:03:17 +0200
parents ee11772d0ad2 a0e7ad5425d4
children 49728858c35e 038a4d09406f
line wrap: on
line diff
--- a/mm7_6.cpp	Thu Feb 14 13:58:34 2013 +0200
+++ b/mm7_6.cpp	Thu Feb 14 14:03:17 2013 +0200
@@ -8943,17 +8943,29 @@
             if ( pCurrentScreen )
               break;
             if (!pParty->bTurnBasedModeOn)
-              goto _do_move_forward;
-            if (pTurnEngine->field_4 != 1 && pTurnEngine->field_4 != 2 && pTurnEngine->uActionPointsLeft > 0 )
+              //goto _do_move_forward;
             {
-              pTurnEngine->uActionPointsLeft -= 26;
-_do_move_forward:
               v5 = pActionQueue;
               if ( pParty->uFlags2 & PARTY_FLAGS_2_RUNNING)
                 partyAction = PARTY_RunForward;
               else
                 partyAction = PARTY_WalkForward;
-              goto _add_action_and_continue;
+              //goto _add_action_and_continue;
+              v5->Add(partyAction);
+              break;
+            }
+            if (pTurnEngine->field_4 != 1 && pTurnEngine->field_4 != 2 && pTurnEngine->uActionPointsLeft > 0 )
+            {
+              pTurnEngine->uActionPointsLeft -= 26;
+//_do_move_forward:
+              v5 = pActionQueue;
+              if ( pParty->uFlags2 & PARTY_FLAGS_2_RUNNING)
+                partyAction = PARTY_RunForward;
+              else
+                partyAction = PARTY_WalkForward;
+              //goto _add_action_and_continue;
+              v5->Add(partyAction);
+              break;
             }
             break;
           case INPUT_MoveBackwards:
@@ -8968,7 +8980,9 @@
                 partyAction = PARTY_RunBackward;
               else
                 partyAction = PARTY_WalkBackward;
-              goto _add_action_and_continue;
+              //goto _add_action_and_continue;
+              v5->Add(partyAction);
+              break;
             }
             if ( pTurnEngine->field_4 != 1 && pTurnEngine->field_4 != 2 && pTurnEngine->uActionPointsLeft > 0 )
             {
@@ -8979,7 +8993,9 @@
                 partyAction = PARTY_RunBackward;
               else
                 partyAction = PARTY_WalkBackward;
-              goto _add_action_and_continue;
+              //goto _add_action_and_continue;
+              v5->Add(partyAction);
+              break;
             }
             break;
           case INPUT_StrafeLeft:
@@ -8990,14 +9006,20 @@
               //goto _do_strafe_left;
             {
               partyAction = PARTY_StrafeLeft;
-              goto _add_action_and_continue_;
+              //goto _add_action_and_continue_;
+              v5 = pActionQueue;
+              v5->Add(partyAction);
+              break;
             }
             if ( pTurnEngine->field_4 == 1 || pTurnEngine->field_4 == 2 || pTurnEngine->uActionPointsLeft <= 0 )
               break;
             pTurnEngine->uActionPointsLeft -= 26;
 //_do_strafe_left:
             partyAction = PARTY_StrafeLeft;
-            goto _add_action_and_continue_;
+            //goto _add_action_and_continue_;
+              v5 = pActionQueue;
+              v5->Add(partyAction);
+              break;
           case INPUT_StrafeRight:
             //__debugbreak();
             if ( pCurrentScreen )
@@ -9006,14 +9028,20 @@
               //goto _do_strafe_right;
             {
               partyAction = PARTY_StrafeRight;
-              goto _add_action_and_continue_;
+              //goto _add_action_and_continue_;
+              v5 = pActionQueue;
+              v5->Add(partyAction);
+              break;
             }
             if ( pTurnEngine->field_4 == 1 || pTurnEngine->field_4 == 2 || pTurnEngine->uActionPointsLeft <= 0 )
               break;
             pTurnEngine->uActionPointsLeft -= 26;
 //_do_strafe_right:
             partyAction = PARTY_StrafeRight;
-            goto _add_action_and_continue_;
+            //goto _add_action_and_continue_;
+            v5 = pActionQueue;
+            v5->Add(partyAction);
+            break;
           case INPUT_TurnLeft:
             if ( pCurrentScreen )
               break;
@@ -9038,7 +9066,9 @@
             if (uCurrentlyLoadedLevelType == LEVEL_Outdoor && pWeather->bRenderSnow)
             {
               v20 = 10;
-              goto LABEL_75;
+              //goto LABEL_75;
+              pWeather->_4C2F0B(v20);
+              break;
             }
             break;
           case INPUT_TurnRight:
@@ -9065,7 +9095,7 @@
             if (uCurrentlyLoadedLevelType == LEVEL_Outdoor && pWeather->bRenderSnow)
             {
               v20 = -10;
-LABEL_75:
+//LABEL_75:
               pWeather->_4C2F0B(v20);
             }
             break;
@@ -9075,7 +9105,10 @@
               || pParty->bTurnBasedModeOn)
               break;
             partyAction = (PartyAction)12;
-            goto _add_action_and_continue_;
+            //goto _add_action_and_continue_;
+            v5 = pActionQueue;
+            v5->Add(partyAction);
+            break;
           case INPUT_Yell:
             //__debugbreak();
             if ( !pCurrentScreen
@@ -9152,7 +9185,11 @@
               if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
               {
                 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)23;
-                goto _send_message;
+                //goto _send_message;
+                pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
+                *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
+                ++pMessageQueue_50CBD0->uNumMessages;
+                break;
               }
             }
             else
@@ -9182,9 +9219,13 @@
               if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 )
                 break;
               pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)404;
-              goto _send_message;
+              //goto _send_message;
+              pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
+              *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
+              ++pMessageQueue_50CBD0->uNumMessages;
+              break;
             }
-            if ( pCurrentScreen == 4 )
+            if ( pCurrentScreen == SCREEN_NPC_DIALOGUE )
             {
               v11 = pMessageQueue_50CBD0->uNumMessages;
               if ( pMessageQueue_50CBD0->uNumMessages )
@@ -9193,9 +9234,9 @@
                 {
                   v11 = 1;
                   pMessageQueue_50CBD0->uNumMessages = 1;
-LABEL_132:
+//LABEL_132:
                   pMessageQueue_50CBD0->pMessages[v11].eType = (UIMessageType)113;
-_send_message:
+//_send_message:
                   pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
                   *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
                   ++pMessageQueue_50CBD0->uNumMessages;
@@ -9205,57 +9246,83 @@
                 pMessageQueue_50CBD0->uNumMessages = 0;
               }
               if ( (signed int)v11 < 40 )
-                goto LABEL_132;
+                //goto LABEL_132;
+              {
+                pMessageQueue_50CBD0->pMessages[v11].eType = (UIMessageType)113;
+                pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
+                *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
+                ++pMessageQueue_50CBD0->uNumMessages;
+                break;
+              }
             }
             break;
           case INPUT_CharCycle:
             //__debugbreak();
-            if ( pCurrentScreen == 8
+            if ( pCurrentScreen == SCREEN_SPELL_BOOK
               || dword_50C9E8 >= 40 )
               break;
             dword_50C9EC[3 * dword_50C9E8] = 176;
-            goto LABEL_155;
+            //goto LABEL_155;
+            dword_50C9F0[3 * dword_50C9E8] = 0;
+            *(&dword_50C9E8 + 3 * dword_50C9E8 + 3) = 0;
+            ++dword_50C9E8;
+            break;
           case INPUT_LookUp:
             //__debugbreak();
             if ( pEventTimer->bPaused )
               break;
             partyAction = (PartyAction)7;
-            goto _add_action_and_continue_;
+            //goto _add_action_and_continue_;
+            v5 = pActionQueue;
+            v5->Add(partyAction);
+            break;
           case INPUT_CenterView:
             //__debugbreak();
             if ( pEventTimer->bPaused )
               break;
             partyAction = (PartyAction)9;
-            goto _add_action_and_continue_;
+            //goto _add_action_and_continue_;
+            v5 = pActionQueue;
+            v5->Add(partyAction);
+            break;
           case INPUT_LookDown:
             //__debugbreak();
             if ( pEventTimer->bPaused )
               break;
             partyAction = (PartyAction)8;
-            goto _add_action_and_continue_;
+            //goto _add_action_and_continue_;
+            v5 = pActionQueue;
+            v5->Add(partyAction);
+            break;
           case INPUT_FlyUp:
             //__debugbreak();
             if ( pCurrentScreen
               || pEventTimer->bPaused )
               break;
             partyAction = (PartyAction)13;
-            goto _add_action_and_continue_;
+            //goto _add_action_and_continue_;
+            v5 = pActionQueue;
+            v5->Add(partyAction);
+            break;
           case INPUT_Land:
             //__debugbreak();
             if ( pCurrentScreen
               || pEventTimer->bPaused )
               break;
             partyAction = (PartyAction)15;
-            goto _add_action_and_continue_;
+            //goto _add_action_and_continue_;
+            v5 = pActionQueue;
+            v5->Add(partyAction);
+            break;
           case INPUT_FlyDown:
             //__debugbreak();
             if ( !pCurrentScreen
               && !pEventTimer->bPaused )
             {
               partyAction = (PartyAction)14;
-_add_action_and_continue_:
+//_add_action_and_continue_:
               v5 = pActionQueue;
-_add_action_and_continue:
+//_add_action_and_continue:
               v5->Add(partyAction);
             }
             break;
@@ -9264,13 +9331,17 @@
             if ( dword_50C9E8 >= 40 )
               break;
             dword_50C9EC[3 * dword_50C9E8] = 367;
-            goto LABEL_155;
+            //goto LABEL_155;
+            dword_50C9F0[3 * dword_50C9E8] = 0;
+            *(&dword_50C9E8 + 3 * dword_50C9E8 + 3) = 0;
+            ++dword_50C9E8;
+            break;
           case INPUT_ZoomOut:
             //__debugbreak();
             if ( dword_50C9E8 < 40 )
             {
               dword_50C9EC[3 * dword_50C9E8] = 368;
-LABEL_155:
+//LABEL_155:
               dword_50C9F0[3 * dword_50C9E8] = 0;
               *(&dword_50C9E8 + 3 * dword_50C9E8 + 3) = 0;
               ++dword_50C9E8;
@@ -9311,8 +9382,8 @@
         ++pMessageQueue_50CBD0->uNumMessages;
         goto LABEL_175;
       }
-      if ( pCurrentScreen == 4
-        || pCurrentScreen == 19 )
+      if ( pCurrentScreen == SCREEN_NPC_DIALOGUE
+        || pCurrentScreen == SCREEN_BRANCHLESS_NPC_DIALOG )
       {
         v15 = pMessageQueue_50CBD0->uNumMessages;
         if ( pMessageQueue_50CBD0->uNumMessages )