changeset 441:acd8fa960c32

Pressing escape crashes no more
author Nomad
date Sun, 24 Feb 2013 15:21:24 +0200
parents 17c90e543e28
children a812665688e4
files mm7_2.cpp mm7_6.cpp
diffstat 2 files changed, 16 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/mm7_2.cpp	Sun Feb 24 09:52:29 2013 +0200
+++ b/mm7_2.cpp	Sun Feb 24 15:21:24 2013 +0200
@@ -11669,7 +11669,7 @@
   //HDC v9; // edi@41
   HDC v10; // edi@50
   int v11; // esi@50
-  char v12; // zf@132
+  //char v12; // zf@132
   signed int v13; // eax@135
   int v14; // eax@139
   int v15; // eax@140
@@ -11935,8 +11935,8 @@
       v37 = 0;
       v36 = 2;
       v35 = ::hWnd;
-LABEL_104:
-      SendMessageA(v35, v36, v37, v38);
+//LABEL_104:
+      SendMessageA(::hWnd, WM_DESTROY, v37, v38);
       return 0;
     }
     if ( dword_506E68 != -1 )
@@ -11948,16 +11948,16 @@
     {
       if ( pVideoPlayer->pVideoFrame.pPixels )
         pVideoPlayer->bStopBeforeSchedule = 1;
-      if ( wParam != 13 )
-      {
-        if ( wParam == 17 )
+      if ( wParam != VK_RETURN )
+      {
+        if ( wParam == VK_CONTROL )
         {
           dword_507B98_ctrl_pressed = 1;
           return 0;
         }
-        if ( wParam == 27 )
-        {
-          pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, !v12, 0);
+        if ( wParam == VK_ESCAPE )
+        {
+          pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, window_SpeakInHouse != 0, 0);
           /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
           {
             v12 = window_SpeakInHouse == 0;
@@ -11968,18 +11968,19 @@
           }*/
           return 0;
         }
-        if ( wParam <= 0x24 )
+        if ( wParam <= VK_HOME )
           return 0;
-        if ( wParam > 0x28 )
-        {
-          if ( wParam != 115 || pVideoPlayer->AnyMovieLoaded() )
+        if ( wParam > VK_DOWN )
+        {
+          if ( wParam != VK_F4 || pVideoPlayer->AnyMovieLoaded() )
             return 0;
           v38 = 0;
           v37 = 104;
 LABEL_126:
           v36 = 273;
           v35 = hWnd;
-          goto LABEL_104;
+          SendMessageA(hWnd, WM_COMMAND, v37, v38);
+          return 0;
         }
         if ( pCurrentScreen
           && pCurrentScreen != SCREEN_PRESS_ESCAPE_MESSAGE )
--- a/mm7_6.cpp	Sun Feb 24 09:52:29 2013 +0200
+++ b/mm7_6.cpp	Sun Feb 24 15:21:24 2013 +0200
@@ -2359,7 +2359,7 @@
       }
       ++v15;
     }
-    while ( (signed int)v15 < (signed int)&unk_50C190 );
+    while (v15 < pStru277 + 10);
     int result = pStru277->PushStru277(a2a, a3a, a4, v6, a6);
     if ( result != -1 )
     {