diff mm7_6.cpp @ 87:c0cf9393af64

Слияние
author Ritor1
date Mon, 29 Oct 2012 09:28:08 +0600
parents f9a33f75bae3
children 51a5b0dc3f30
line wrap: on
line diff
--- a/mm7_6.cpp	Mon Oct 22 09:20:49 2012 +0600
+++ b/mm7_6.cpp	Mon Oct 29 09:28:08 2012 +0600
@@ -2343,10 +2343,10 @@
         if ( ptr_507BD4 )
           return result;
         ptr_507BD4 = GUIWindow::Create(0, 0, 640, 480, (WindowType)(WINDOW_HouseInterior|0x2), (int)&pStru277[result], 0);
-        ptr_507BD4->CreateButton(0x34u, 0x1A6u, 0x23u, 0, 2, 0, 0x45u, 0, 0x31u, nullstring, 0);
-        ptr_507BD4->CreateButton(0xA5u, 0x1A6u, 0x23u, 0, 2, 0, 0x45u, 1u, 0x32u, nullstring, 0);
-        ptr_507BD4->CreateButton(0x118u, 0x1A6u, 0x23u, 0, 2, 0, 0x45u, 2u, 0x33u, nullstring, 0);
-        ptr_507BD4->CreateButton(0x186u, 0x1A6u, 0x23u, 0, 2, 0, 0x45u, 3u, 0x34u, nullstring, 0);
+        ptr_507BD4->CreateButton(0x34u, 0x1A6u, 0x23u, 0, 2, 0, 0x45u, 0, 0x31u, "", 0);
+        ptr_507BD4->CreateButton(0xA5u, 0x1A6u, 0x23u, 0, 2, 0, 0x45u, 1u, 0x32u, "", 0);
+        ptr_507BD4->CreateButton(0x118u, 0x1A6u, 0x23u, 0, 2, 0, 0x45u, 2u, 0x33u, "", 0);
+        ptr_507BD4->CreateButton(0x186u, 0x1A6u, 0x23u, 0, 2, 0, 0x45u, 3u, 0x34u, "", 0);
         return sub_421B2C_PlaceInInventory_or_DropPickedItem();
       }
       if ( v6 & 8 )
@@ -2355,7 +2355,7 @@
           return result;
         v17 = GUIWindow::Create(0, 0, 640, 480, (WindowType)(WINDOW_HouseInterior|0x2), (int)&pStru277[result], 0);
         v29 = 0;
-        v28 = nullstring;
+        v28 = "";
         v27 = 0;
         v26 = 0;
         v25 = 70;
@@ -2378,7 +2378,7 @@
           return result;
         v17 = GUIWindow::Create(0, 0, 640, 480, (WindowType)(WINDOW_HouseInterior|0x2), (int)&pStru277[result], 0);
         v29 = 0;
-        v28 = nullstring;
+        v28 = "";
         v27 = 0;
         v26 = 0;
         v25 = 190;
@@ -2401,12 +2401,12 @@
         if ( ptr_507BD4 )
           return result;
         ptr_507BD4 = GUIWindow::Create(0, 0, 640, 480, (WindowType)(WINDOW_HouseInterior|0x2), 20 * result + 5292232, 0);
-        ptr_507BD4->CreateButton(0x34u, 0x1A6u, 0x23u, 0, 2, 0, 0x8Du, 0, 0x31u, nullstring, 0);
-        ptr_507BD4->CreateButton(0xA5u, 0x1A6u, 0x23u, 0, 2, 0, 0x8Du, 1u, 0x32u, nullstring, 0);
-        ptr_507BD4->CreateButton(0x118u, 0x1A6u, 0x23u, 0, 2, 0, 0x8Du, 2u, 0x33u, nullstring, 0);
-        ptr_507BD4->CreateButton(0x186u, 0x1A6u, 0x23u, 0, 2, 0, 0x8Du, 3u, 0x34u, nullstring, 0);
+        ptr_507BD4->CreateButton(0x34u, 0x1A6u, 0x23u, 0, 2, 0, 0x8Du, 0, 0x31u, "", 0);
+        ptr_507BD4->CreateButton(0xA5u, 0x1A6u, 0x23u, 0, 2, 0, 0x8Du, 1u, 0x32u, "", 0);
+        ptr_507BD4->CreateButton(0x118u, 0x1A6u, 0x23u, 0, 2, 0, 0x8Du, 2u, 0x33u, "", 0);
+        ptr_507BD4->CreateButton(0x186u, 0x1A6u, 0x23u, 0, 2, 0, 0x8Du, 3u, 0x34u, "", 0);
         v29 = 0;
-        v28 = nullstring;
+        v28 = "";
         v27 = 0;
         v26 = 0;
         v25 = 140;
@@ -2432,7 +2432,7 @@
                        0xBCu,
                        0,
                        0,
-                       nullstring,
+                       "",
                        (Texture *)(uTextureID_507990 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_507990] : 0),
                        0);
         ptr_5079E8 = ptr_507BD4->CreateButton(
@@ -2445,10 +2445,10 @@
                        0xBCu,
                        1u,
                        0,
-                       nullstring,
+                       "",
                        (Texture *)(uTextureID_50798C != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_50798C] : 0),
                        0);
-        ptr_507BD4->CreateButton(0x1EBu, 0x95u, 0x40u, 0x4Au, 1, 0, 0x8Fu, 4u, 0x35u, nullstring, 0);
+        ptr_507BD4->CreateButton(0x1EBu, 0x95u, 0x40u, 0x4Au, 1, 0, 0x8Fu, 4u, 0x35u, "", 0);
         result = (bool)ptr_507BD4->CreateButton(
                          0x231u,
                          0x95u,
@@ -2459,7 +2459,7 @@
                          0x8Fu,
                          5u,
                          0x36u,
-                         nullstring,
+                         "",
                          0);
       }
     }
@@ -3490,10 +3490,10 @@
         if ( v17->WearsItem(510, 2) )
           a1.uObjectDescID = pObjectList->ObjectIDByItemID(0xBD6u);
         a1.vPosition.x = pParty->vPosition.x;
-        a1.vPosition.y = pParty->vPosition.z;
+        a1.vPosition.y = pParty->vPosition.y;
         a1.uAttributes = 0;
         a1.uSpriteFrameID = 0;
-        a1.vPosition.z = pParty->vPosition.y + (signed int)pParty->uPartyHeight / 3;
+        a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3;
         v19 = 8 * v3->uPlayerID;
         LOBYTE(v19) = v19 | 4;
         a1.field_58 = v19;
@@ -3528,10 +3528,10 @@
         a1.field_50 = v731;
         a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType);
         a1.vPosition.x = pParty->vPosition.x;
-        a1.vPosition.y = pParty->vPosition.z;
+        a1.vPosition.y = pParty->vPosition.y;
         a1.uAttributes = 0;
         a1.uSpriteFrameID = 0;
-        a1.vPosition.z = pParty->vPosition.y + (signed int)pParty->uPartyHeight / 2;
+        a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 2;
         v22 = 8 * v3->uPlayerID;
         LOBYTE(v22) = v22 | 4;
         a1.field_58 = v22;
@@ -3545,7 +3545,7 @@
                                                                          * pParty->pPlayers[v3->uPlayerID].pEquipment.uMainHand
                                                                          + 5],
           sizeof(a1.stru_24));
-        v23 = pIndoor->GetSector(pParty->vPosition.x, pParty->vPosition.z, a1.vPosition.z);
+        v23 = pIndoor->GetSector(pParty->vPosition.x, pParty->vPosition.y, a1.vPosition.z);
         HIBYTE(a1.uAttributes) |= 1u;
         a1.uSectorID = v23;
         if ( pParty->bTurnBasedModeOn == 1 )
@@ -3629,14 +3629,14 @@
         a1.field_4C = v2;
         a1.field_50 = v731;
         a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType);
-        a1.vPosition.y = pParty->vPosition.z;
+        a1.vPosition.y = pParty->vPosition.y;
         a1.vPosition.x = pParty->vPosition.x;
         a1.uAttributes = v1;
-        a1.vPosition.z = pParty->vPosition.y + (signed int)pParty->uPartyHeight / 3;
+        a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3;
         a1.uSectorID = pIndoor->GetSector(
                          pParty->vPosition.x,
-                         pParty->vPosition.z,
-                         pParty->vPosition.y + (signed int)pParty->uPartyHeight / 3);
+                         pParty->vPosition.y,
+                         pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3);
         a1.uSpriteFrameID = v1;
         v34 = 8 * v3->uPlayerID;
         LOBYTE(v34) = v34 | 4;
@@ -3791,14 +3791,14 @@
         a1.field_4C = v2;
         a1.field_50 = v731;
         a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType);
-        a1.vPosition.y = pParty->vPosition.z;
+        a1.vPosition.y = pParty->vPosition.y;
         a1.vPosition.x = pParty->vPosition.x;
         a1.uAttributes = v1;
-        a1.vPosition.z = pParty->vPosition.y + (signed int)pParty->uPartyHeight / 3;
+        a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3;
         a1.uSectorID = pIndoor->GetSector(
                          pParty->vPosition.x,
-                         pParty->vPosition.z,
-                         pParty->vPosition.y + (signed int)pParty->uPartyHeight / 3);
+                         pParty->vPosition.y,
+                         pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3);
         a1.uSpriteFrameID = v1;
         v50 = 8 * v3->uPlayerID;
         LOBYTE(v50) = v50 | 4;
@@ -3823,10 +3823,10 @@
         a1.field_4C = v2;
         a1.field_50 = v731;
         a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType);
-        v51 = pParty->vPosition.y + (signed int)pParty->uPartyHeight / 2;
-        a1.vPosition.y = pParty->vPosition.z;
-        v671 = pParty->vPosition.y + (signed int)pParty->uPartyHeight / 2;
-        v660 = pParty->vPosition.z;
+        v51 = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 2;
+        a1.vPosition.y = pParty->vPosition.y;
+        v671 = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 2;
+        v660 = pParty->vPosition.y;
         goto LABEL_153;
       case 87:
         if ( uCurrentlyLoadedLevelType == LEVEL_Indoor
@@ -3937,13 +3937,13 @@
         a1.stru_24.Reset();
         a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType);
         a1.vPosition.x = pParty->vPosition.x;
-        a1.vPosition.y = pParty->vPosition.z;
+        a1.vPosition.y = pParty->vPosition.y;
         a1.uAttributes = v1;
-        a1.vPosition.z = pParty->vPosition.y + (signed int)pParty->uPartyHeight / 3;
+        a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3;
         a1.uSectorID = pIndoor->GetSector(
                          pParty->vPosition.x,
-                         pParty->vPosition.z,
-                         pParty->vPosition.y + (signed int)pParty->uPartyHeight / 3);
+                         pParty->vPosition.y,
+                         pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3);
         a1.uSpriteFrameID = v1;
         v62 = 8 * v3->uPlayerID;
         LOBYTE(v62) = v62 | 4;
@@ -4308,8 +4308,8 @@
         {
           v730 = a2 >> 3;
           v112 = &pActors[a2 >> 3];
-          v726 = (Player *)abs(v112->vPosition.z - pParty->vPosition.y);
-          v721 = abs(v112->vPosition.y - pParty->vPosition.z);
+          v726 = (Player *)abs(v112->vPosition.z - pParty->vPosition.z);
+          v721 = abs(v112->vPosition.y - pParty->vPosition.y);
           v113 = abs(v112->vPosition.x - pParty->vPosition.x);
           _this = (ItemGen *)v113;
           v114 = v721;
@@ -4504,8 +4504,8 @@
           v155 = stru_5C6E00->SinCos(pParty->sRotationY);
           uRequiredMana = pParty->vPosition.x + sub_42EBBE(2048, v155);
           v156 = stru_5C6E00->_42EBDB(pParty->sRotationY);
-          LODWORD(v727) = pParty->vPosition.z + sub_42EBBE(2048, v156);
-          v154 = pParty->vPosition.y;
+          LODWORD(v727) = pParty->vPosition.y + sub_42EBBE(2048, v156);
+          v154 = pParty->vPosition.z;
         }
         HIDWORD(v733) = v154;
         v713 = v154 + 2500;
@@ -4728,14 +4728,14 @@
         a1.field_4C = v2;
         a1.field_50 = v731;
         a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType);
-        a1.vPosition.y = pParty->vPosition.z;
+        a1.vPosition.y = pParty->vPosition.y;
         a1.vPosition.x = pParty->vPosition.x;
         a1.uAttributes = v1;
-        a1.vPosition.z = pParty->vPosition.y + (signed int)pParty->uPartyHeight / 3;
+        a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3;
         a1.uSectorID = pIndoor->GetSector(
                          pParty->vPosition.x,
-                         pParty->vPosition.z,
-                         pParty->vPosition.y + (signed int)pParty->uPartyHeight / 3);
+                         pParty->vPosition.y,
+                         pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3);
         a1.uSpriteFrameID = v1;
         v187 = 8 * v3->uPlayerID;
         LOBYTE(v187) = v187 | 4;
@@ -4909,8 +4909,8 @@
           LODWORD(v718) = pParty->vPosition.x + sub_42EBBE(2048, v212);
           v213 = stru_5C6E00->_42EBDB(pParty->sRotationY);
           v214 = sub_42EBBE(2048, v213);
-          v211 = pParty->vPosition.y;
-          v713 = pParty->vPosition.z + v214;
+          v211 = pParty->vPosition.z;
+          v713 = pParty->vPosition.y + v214;
           v208 = LODWORD(v725);
         }
         v726 = (Player *)v211;
@@ -5038,10 +5038,10 @@
           a1.field_50 = v731;
           a1.field_4C = v2;
           a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType);
-          a1.vPosition.y = pParty->vPosition.z;
-          v51 = pParty->vPosition.y + (signed int)pParty->uPartyHeight / 3;
-          v671 = pParty->vPosition.y + (signed int)pParty->uPartyHeight / 3;
-          v660 = pParty->vPosition.z;
+          a1.vPosition.y = pParty->vPosition.y;
+          v51 = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3;
+          v671 = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3;
+          v660 = pParty->vPosition.y;
 LABEL_153:
           a1.uAttributes = v1;
           a1.vPosition.x = pParty->vPosition.x;
@@ -5076,14 +5076,14 @@
           a1.field_4C = v2;
           a1.field_50 = v731;
           a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType);
-          a1.vPosition.y = pParty->vPosition.z;
+          a1.vPosition.y = pParty->vPosition.y;
           a1.vPosition.x = pParty->vPosition.x;
           a1.uAttributes = v1;
-          a1.vPosition.z = pParty->vPosition.y + (signed int)pParty->uPartyHeight / 3;
+          a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3;
           a1.uSectorID = pIndoor->GetSector(
                            pParty->vPosition.x,
-                           pParty->vPosition.z,
-                           pParty->vPosition.y + (signed int)pParty->uPartyHeight / 3);
+                           pParty->vPosition.y,
+                           pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3);
           a1.uSpriteFrameID = v1;
           v226 = 8 * v3->uPlayerID;
           LOBYTE(v226) = v226 | 4;
@@ -5661,14 +5661,14 @@
         a1.field_4C = v2;
         a1.field_50 = v731;
         a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType);
-        a1.vPosition.y = pParty->vPosition.z;
+        a1.vPosition.y = pParty->vPosition.y;
         a1.vPosition.x = pParty->vPosition.x;
         a1.uAttributes = v1;
-        a1.vPosition.z = pParty->vPosition.y + (signed int)pParty->uPartyHeight / 3;
+        a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3;
         a1.uSectorID = pIndoor->GetSector(
                          pParty->vPosition.x,
-                         pParty->vPosition.z,
-                         pParty->vPosition.y + (signed int)pParty->uPartyHeight / 3);
+                         pParty->vPosition.y,
+                         pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3);
         a1.uSpriteFrameID = v1;
         v326 = 8 * v3->uPlayerID;
         LOBYTE(v326) = v326 | 4;
@@ -5695,11 +5695,11 @@
         a1.field_50 = v731;
         a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType);
         a1.vPosition.x = pParty->vPosition.x;
-        a1.vPosition.y = pParty->vPosition.z;
+        a1.vPosition.y = pParty->vPosition.y;
         a1.uAttributes = v1;
         a1.uSectorID = v1;
         a1.uSpriteFrameID = v1;
-        a1.vPosition.z = pParty->vPosition.y + (signed int)pParty->uPartyHeight / 3;
+        a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3;
         v327 = 8 * v3->uPlayerID;
         LOBYTE(v327) = v327 | 4;
         a1.field_60_distance_related_prolly_lod = 0;
@@ -7360,13 +7360,13 @@
         a1.field_50 = v731;
         a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType);
         a1.vPosition.x = pParty->vPosition.x;
-        a1.vPosition.y = pParty->vPosition.z;
+        a1.vPosition.y = pParty->vPosition.y;
         a1.uAttributes = v1;
-        a1.vPosition.z = pParty->vPosition.y + (signed int)pParty->uPartyHeight / 2;
+        a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 2;
         a1.uSectorID = pIndoor->GetSector(
                          pParty->vPosition.x,
-                         pParty->vPosition.z,
-                         pParty->vPosition.y + (signed int)pParty->uPartyHeight / 2);
+                         pParty->vPosition.y,
+                         pParty->vPosition.z + (signed int)pParty->uPartyHeight / 2);
         a1.uSpriteFrameID = v1;
         v595 = 8 * v3->uPlayerID;
         LOBYTE(v595) = v595 | 4;
@@ -7694,7 +7694,7 @@
           v642 = rand() % 4096 - 2048;
           v643 = rand();
           v721 = v642 + pParty->vPosition.x;
-          y = (char *)(pParty->vPosition.z + v643 % 4096 - 2048);
+          y = (char *)(pParty->vPosition.y + v643 % 4096 - 2048);
           v732 = GetTerrainHeightsAroundParty2(v642 + pParty->vPosition.x, (int)y, (int *)&v710, v1);
           v644 = rand();
           sub_42F7EB_DropItemAt(0xFE6u, v721, (int)y, v732 + 16, v644 % 500 + 500, 1, v1, v1, (ItemGen *)v1);
@@ -7909,7 +7909,7 @@
     {
       a2 = v34 >> 3;
       v8 = &pActors[v34 >> 3];
-      v34 = sub_452A9E((v8->vPosition.x - pParty->vPosition.x) * (v8->vPosition.x - pParty->vPosition.x) + (v8->vPosition.y - pParty->vPosition.z) * (v8->vPosition.y - pParty->vPosition.z) + (v8->vPosition.z - pParty->vPosition.y) * (v8->vPosition.z - pParty->vPosition.y))
+      v34 = sub_452A9E((v8->vPosition.x - pParty->vPosition.x) * (v8->vPosition.x - pParty->vPosition.x) + (v8->vPosition.y - pParty->vPosition.y) * (v8->vPosition.y - pParty->vPosition.y) + (v8->vPosition.z - pParty->vPosition.z) * (v8->vPosition.z - pParty->vPosition.z))
           - v8->uActorRadius;
       if ( v34 >= 0 )
       {
@@ -7956,8 +7956,8 @@
       if ( (double)v34 <= 407.2 )
       {
         a3.x = v8->vPosition.x - pParty->vPosition.x;
-        a3.y = v8->vPosition.y - pParty->vPosition.z;
-        a3.z = v8->vPosition.z - pParty->vPosition.y;
+        a3.y = v8->vPosition.y - pParty->vPosition.y;
+        a3.z = v8->vPosition.z - pParty->vPosition.z;
         Vec3_int_::Normalize(&a3.x, &a3.y, &a3.z);
         DamageMonsterFromParty((8 * v0 - 8) | 4, a2, &a3);
         if ( v1->WearsItem(506, 1) || v1->WearsItem(506, 0) )
@@ -8321,8 +8321,8 @@
     while ( 1 )
     {
       v2 = abs(*((short *)v1 - 17) - pParty->vPosition.x);
-      v11 = abs(*((short *)v1 - 16) - pParty->vPosition.z);
-      v12 = abs(*((short *)v1 - 15) - pParty->vPosition.y);
+      v11 = abs(*((short *)v1 - 16) - pParty->vPosition.y);
+      v12 = abs(*((short *)v1 - 15) - pParty->vPosition.z);
       v3 = v2;
       v4 = v11;
       v5 = v12;
@@ -8862,8 +8862,6 @@
 //----- (0042FC4E) --------------------------------------------------------
 void __cdecl ProcessInputActions()
 {
-  Keyboard *v0; // ecx@1
-  signed int _1; // ebx@7
   ActionQueue *pActionQueue; // esi@7
   Keyboard *v3; // ecx@8
   char v4; // al@9
@@ -8889,24 +8887,27 @@
   int v24; // [sp+4h] [bp-4h]@87
 
   pGame->pKeyboardInstance->EnterCriticalSection();
-  v0 = pGame->pKeyboardInstance;
-  if ( !bAlwaysRun )
+  auto pKeyboard = pGame->pKeyboardInstance;
+  if (!bAlwaysRun)
   {
-    if ( v0->IsShiftHeld() )
-      goto _set_running;
-_set_not_running:
-    pParty->uFlags2 &= 0xFFFFFFFDu;
-    goto LABEL_6;
+    if (pKeyboard->IsShiftHeld())
+      pParty->uFlags2 |= PARTY_FLAGS_2_RUNNING;
+    else
+      pParty->uFlags2 &= ~PARTY_FLAGS_2_RUNNING;
+   }
+  else
+  {
+    if (pKeyboard->IsShiftHeld())
+      pParty->uFlags2 &= ~PARTY_FLAGS_2_RUNNING;
+    else
+      pParty->uFlags2 |= PARTY_FLAGS_2_RUNNING;
   }
-  if ( v0->IsShiftHeld() )
-    goto _set_not_running;
-_set_running:
+
   pParty->uFlags2 |= PARTY_FLAGS_2_RUNNING;
 LABEL_6:
   if ( !pEventTimer->bPaused )
   {
     inputAction = (InputAction)0;
-    _1 = 1;
     pActionQueue = pPartyActionQueue;
     while ( 1 )
     {
@@ -8921,11 +8922,11 @@
         switch ( inputAction )
         {
           case INPUT_MoveForward:
-            if ( uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions )
+            if ( pCurrentScreen )
               break;
-            if ( pParty->bTurnBasedModeOn != _1 )
+            if (!pParty->bTurnBasedModeOn)
               goto _do_move_forward;
-            if ( pTurnEngine->field_4 != _1 && pTurnEngine->field_4 != 2 && pTurnEngine->uActionPointsLeft > 0 )
+            if (pTurnEngine->field_4 != 1 && pTurnEngine->field_4 != 2 && pTurnEngine->uActionPointsLeft > 0 )
             {
               pTurnEngine->uActionPointsLeft -= 26;
 _do_move_forward:
@@ -8938,11 +8939,12 @@
             }
             break;
           case INPUT_MoveBackwards:
-            if ( uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions )
+            __debugbreak();
+            if ( pCurrentScreen )
               break;
-            if ( pParty->bTurnBasedModeOn != _1 )
+            if (!pParty->bTurnBasedModeOn)
               goto _do_move_backwards;
-            if ( pTurnEngine->field_4 != _1 && pTurnEngine->field_4 != 2 && pTurnEngine->uActionPointsLeft > 0 )
+            if ( pTurnEngine->field_4 != 1 && pTurnEngine->field_4 != 2 && pTurnEngine->uActionPointsLeft > 0 )
             {
               pTurnEngine->uActionPointsLeft -= 26;
 _do_move_backwards:
@@ -8955,35 +8957,37 @@
             }
             break;
           case INPUT_StrafeLeft:
-            if ( uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions )
+            __debugbreak();
+            if ( pCurrentScreen )
               break;
-            if ( pParty->bTurnBasedModeOn != _1 )
+            if (!pParty->bTurnBasedModeOn)
               goto _do_strafe_left;
-            if ( pTurnEngine->field_4 == _1 || pTurnEngine->field_4 == 2 || pTurnEngine->uActionPointsLeft <= 0 )
+            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_;
           case INPUT_StrafeRight:
-            if ( uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions )
+            __debugbreak();
+            if ( pCurrentScreen )
               break;
-            if ( pParty->bTurnBasedModeOn != _1 )
+            if (!pParty->bTurnBasedModeOn)
               goto _do_strafe_right;
-            if ( pTurnEngine->field_4 == _1 || pTurnEngine->field_4 == 2 || pTurnEngine->uActionPointsLeft <= 0 )
+            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_;
           case INPUT_TurnLeft:
-            if ( uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions )
+            if ( pCurrentScreen )
               break;
             if ( GetAsyncKeyState(VK_CONTROL) ) // strafing
             {
-              if ( pParty->bTurnBasedModeOn == _1 )
+              if (pParty->bTurnBasedModeOn)
               {
-                if ( pTurnEngine->field_4 == _1 || pTurnEngine->field_4 == 2 || pTurnEngine->uActionPointsLeft <= 0 )
+                if ( pTurnEngine->field_4 == 1 || pTurnEngine->field_4 == 2 || pTurnEngine->uActionPointsLeft <= 0 )
                   break;
                 pTurnEngine->uActionPointsLeft -= 26;
               }
@@ -8994,23 +8998,23 @@
               if ( pParty->uFlags2 & 2 )
                 partyAction_ = PARTY_FastTurnLeft;
               else
-                partyAction_ = (PartyAction)_1;
+                partyAction_ = PARTY_TurnLeft;
             }
             pActionQueue->Add(partyAction_);
-            if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor && pWeather->bRenderSnow == _1 )
+            if (uCurrentlyLoadedLevelType == LEVEL_Outdoor && pWeather->bRenderSnow)
             {
               v20 = 10;
               goto LABEL_75;
             }
             break;
           case INPUT_TurnRight:
-            if ( uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions )
+            if ( pCurrentScreen )
               break;
             if ( GetAsyncKeyState(17) )         // strafing
             {
-              if ( pParty->bTurnBasedModeOn == _1 )
+              if (pParty->bTurnBasedModeOn)
               {
-                if ( pTurnEngine->field_4 == _1 || pTurnEngine->field_4 == 2 || pTurnEngine->uActionPointsLeft <= 0 )
+                if ( pTurnEngine->field_4 == 1 || pTurnEngine->field_4 == 2 || pTurnEngine->uActionPointsLeft <= 0 )
                   break;
                 pTurnEngine->uActionPointsLeft -= 26;
               }
@@ -9024,7 +9028,7 @@
                 v21 = 2;
             }
             pActionQueue->Add((PartyAction)v21);
-            if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor && pWeather->bRenderSnow == _1 )
+            if (uCurrentlyLoadedLevelType == LEVEL_Outdoor && pWeather->bRenderSnow)
             {
               v20 = -10;
 LABEL_75:
@@ -9032,13 +9036,15 @@
             }
             break;
           case INPUT_Jump:
-            if ( uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions
-              || pParty->bTurnBasedModeOn == _1 )
+            __debugbreak();
+            if ( pCurrentScreen
+              || pParty->bTurnBasedModeOn)
               break;
             partyAction = (PartyAction)12;
             goto _add_action_and_continue_;
           case INPUT_Yell:
-            if ( !uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions
+            __debugbreak();
+            if ( !pCurrentScreen
               && uActiveCharacter )
             {
               pParty->Yell();
@@ -9046,9 +9052,10 @@
             }
             break;
           case INPUT_Pass:
-            if ( uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions )
+            __debugbreak();
+            if ( pCurrentScreen )
               break;
-            if ( pParty->bTurnBasedModeOn == _1 && pTurnEngine->field_4 == 3 )
+            if (pParty->bTurnBasedModeOn && pTurnEngine->field_4 == 3)
               goto LABEL_118;
             if ( uActiveCharacter )
             {
@@ -9065,27 +9072,29 @@
             }
             break;
           case INPUT_Combat:
-            if ( !uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions )
+            __debugbreak();
+            if ( !pCurrentScreen )
             {
-              if ( pParty->bTurnBasedModeOn == _1 )
+              if (pParty->bTurnBasedModeOn)
               {
                 if ( pTurnEngine->field_4 == 3 || (pTurnEngine->pQueue[0].uPackedID & 7) == 4 )
                 {
                   pParty->bTurnBasedModeOn = 0;
-                  pTurnEngine->End(_1);
+                  pTurnEngine->End(true);
                 }
               }
               else
               {
                 pTurnEngine->Start();
-                pParty->bTurnBasedModeOn = _1;
+                pParty->bTurnBasedModeOn = true;
               }
             }
             break;
           case INPUT_CastReady:
-            if ( uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions )
+            __debugbreak();
+            if ( pCurrentScreen )
               break;
-            if ( pParty->bTurnBasedModeOn == _1 && pTurnEngine->field_4 == 3 )
+            if (pParty->bTurnBasedModeOn && pTurnEngine->field_4 == 3)
               goto LABEL_118;
             if ( !uActiveCharacter )
               break;
@@ -9097,7 +9106,6 @@
                   v10 > v7->sMana) )
             {
               pActionQueue = pPartyActionQueue;
-              _1 = 1;
 LABEL_120:
               if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
               {
@@ -9115,36 +9123,37 @@
                 *(&dword_50C9E8 + 3 * dword_50C9E8 + 3) = 0;
                 ++dword_50C9E8;
               }
-              _1 = 1;
             }
             break;
           default:
+            __debugbreak();
             break;
           case INPUT_Attack:
-            if ( uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions )
+            __debugbreak();
+            if ( pCurrentScreen )
               break;
-            if ( pParty->bTurnBasedModeOn != _1 || pTurnEngine->field_4 != 3 )
+            if (!pParty->bTurnBasedModeOn || pTurnEngine->field_4 != 3)
               goto LABEL_120;
 LABEL_118:
             pTurnEngine->field_18 |= 8u;
             break;
           case INPUT_EventTrigger:
-            if ( !uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions )
+            if ( !pCurrentScreen )
             {
               if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 )
                 break;
               pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)404;
               goto _send_message;
             }
-            if ( uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions == 4 )
+            if ( pCurrentScreen == 4 )
             {
               v11 = pMessageQueue_50CBD0->uNumMessages;
               if ( pMessageQueue_50CBD0->uNumMessages )
               {
                 if ( pMessageQueue_50CBD0->pMessages[0].field_8 )
                 {
-                  v11 = _1;
-                  pMessageQueue_50CBD0->uNumMessages = _1;
+                  v11 = 1;
+                  pMessageQueue_50CBD0->uNumMessages = 1;
 LABEL_132:
                   pMessageQueue_50CBD0->pMessages[v11].eType = (UIMessageType)113;
 _send_message:
@@ -9161,40 +9170,47 @@
             }
             break;
           case INPUT_CharCycle:
-            if ( uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions == 8
+            __debugbreak();
+            if ( pCurrentScreen == 8
               || dword_50C9E8 >= 40 )
               break;
             dword_50C9EC[3 * dword_50C9E8] = 176;
             goto LABEL_155;
           case INPUT_LookUp:
+            __debugbreak();
             if ( pEventTimer->bPaused )
               break;
             partyAction = (PartyAction)7;
             goto _add_action_and_continue_;
           case INPUT_CenterView:
+            __debugbreak();
             if ( pEventTimer->bPaused )
               break;
             partyAction = (PartyAction)9;
             goto _add_action_and_continue_;
           case INPUT_LookDown:
+            __debugbreak();
             if ( pEventTimer->bPaused )
               break;
             partyAction = (PartyAction)8;
             goto _add_action_and_continue_;
           case INPUT_FlyUp:
-            if ( uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions
+            __debugbreak();
+            if ( pCurrentScreen
               || pEventTimer->bPaused )
               break;
             partyAction = (PartyAction)13;
             goto _add_action_and_continue_;
           case INPUT_Land:
-            if ( uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions
+            __debugbreak();
+            if ( pCurrentScreen
               || pEventTimer->bPaused )
               break;
             partyAction = (PartyAction)15;
             goto _add_action_and_continue_;
           case INPUT_FlyDown:
-            if ( !uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions
+            __debugbreak();
+            if ( !pCurrentScreen
               && !pEventTimer->bPaused )
             {
               partyAction = (PartyAction)14;
@@ -9205,11 +9221,13 @@
             }
             break;
           case INPUT_ZoomIn:
+            __debugbreak();
             if ( dword_50C9E8 >= 40 )
               break;
             dword_50C9EC[3 * dword_50C9E8] = 367;
             goto LABEL_155;
           case INPUT_ZoomOut:
+            __debugbreak();
             if ( dword_50C9E8 < 40 )
             {
               dword_50C9EC[3 * dword_50C9E8] = 368;
@@ -9240,15 +9258,15 @@
       v14 = v13->IsKeyBeingHeld(v22);
     if ( v14 && v12 == 9 )
     {
-      if ( !uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions )
+      if ( !pCurrentScreen )
       {
         if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 )
           goto LABEL_175;
         pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)404;
         goto LABEL_174;
       }
-      if ( uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions == 4
-        || uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions == 19 )
+      if ( pCurrentScreen == 4
+        || pCurrentScreen == 19 )
       {
         v15 = pMessageQueue_50CBD0->uNumMessages;
         if ( pMessageQueue_50CBD0->uNumMessages )
@@ -9278,7 +9296,7 @@
   }
   while ( v12 < 30 );
 LABEL_176:
-  if ( LOBYTE(pGame->pKeyboardInstance->bUsingAsynKeyboard) )
+  if (pGame->pKeyboardInstance->bUsingAsynKeyboard)
   {
     AsyncKeyboard::LeaveCriticalSection();
     v16 = pAsyncKeyboard;