changeset 922:d4ca429eecd4

Some debug functions implemented.
author Nomad
date Wed, 01 May 2013 11:39:41 +0200
parents 3696848c0413
children 055ac998c606 851697c5c2f2
files mm7_2.cpp mm7_6.cpp
diffstat 2 files changed, 46 insertions(+), 28 deletions(-) [+]
line wrap: on
line diff
--- a/mm7_2.cpp	Tue Apr 30 20:08:42 2013 +0600
+++ b/mm7_2.cpp	Wed May 01 11:39:41 2013 +0200
@@ -6825,8 +6825,52 @@
         GUI_HandleHotkey(wParam);
     }
     return DefWindowProcA(hWnd, Msg, wParam, lParam);
+
+    case WM_COMMAND:
+    {
+      switch (wParam)
+      {
+        case 101:
+        case 40001:
+        {
+          v38 = 0;
+          v37 = 0;
+          v36 = 2;
+          v35 = ::hWnd;
+          SendMessageA(::hWnd, WM_DESTROY, v37, v38);
+        }
+        return 0;
+
+        case 103:
+          pRenderer->SavePCXScreenshot();
+        return 0;
+
+        case 104:
+          pRenderer->ChangeBetweenWinFullscreenModes();
+          if ( pArcomageGame->bGameInProgress )
+            pArcomageGame->field_F6 = 1;
+        return 0;
+
+        case 40007:
+          pParty->SetGold(pParty->uNumGold + 10000);
+        return 0;
+
+        case 40008:
+          GivePartyExp(20000);
+        return 0;
+
+        case 40013:
+          pParty->SetGold(0);
+        return 0;
+
+        case 40059:
+          for (uint i = 0; i < 4; ++i)
+            pParty->pPlayers[i].uSkillPoints = 50;
+        return 0;
+      }
+    }
+    return DefWindowProcA(hWnd, Msg, wParam, lParam);
   };
-  
 
   if ( Msg > WM_SYSCOMMAND )
   {
@@ -7067,33 +7111,7 @@
         //goto _def_wnd_proc;
         return DefWindowProcA(hWnd, Msg, wParam, lParam);
       }
-      if ( Msg != WM_COMMAND )
-        //goto _def_wnd_proc;
         return DefWindowProcA(hWnd, Msg, wParam, lParam);
-      if ( wParam != 101 )
-      {
-        if ( wParam == 103 )
-        {
-          pRenderer->SavePCXScreenshot();
-          return 0;
-        }
-        if ( wParam == 104 )
-        {
-          pRenderer->ChangeBetweenWinFullscreenModes();
-          if ( pArcomageGame->bGameInProgress )
-            pArcomageGame->field_F6 = 1;
-          return 0;
-        }
-        if ( wParam != 40001 )
-          return DefWindowProcA(hWnd, Msg, wParam, lParam);
-      }
-      v38 = 0;
-      v37 = 0;
-      v36 = 2;
-      v35 = ::hWnd;
-//LABEL_104:
-      SendMessageA(::hWnd, WM_DESTROY, v37, v38);
-      return 0;
     }
     if ( dword_506E68 != -1 )
     {
--- a/mm7_6.cpp	Tue Apr 30 20:08:42 2013 +0600
+++ b/mm7_6.cpp	Wed May 01 11:39:41 2013 +0200
@@ -1249,7 +1249,7 @@
         if ( v11 )
         {
           LOBYTE(v7) = v6->GetLearningPercent();
-          v1b = v11 + v11 * v7 / 100;
+          v1b = v11 + v11 * (char)v7 / 100;
           //v8 = __CFADD__((int)v1, LODWORD(v6->uExperience));
 		  //need review
           LODWORD(v6->uExperience) += v1b;