diff mm7_6.cpp @ 370:7f817679b60e

_42777D_CastSpell_UseWand_ShootArrow
author Nomad
date Fri, 22 Feb 2013 17:47:41 +0200
parents 672b83584b0f
children 243418228760
line wrap: on
line diff
--- a/mm7_6.cpp	Fri Feb 22 01:36:54 2013 +0200
+++ b/mm7_6.cpp	Fri Feb 22 17:47:41 2013 +0200
@@ -42,6 +42,7 @@
 #include "texts.h"
 #include "StorylineTextTable.h"
 #include "Events2D.h"
+#include "Log.h"
 
 #include "mm7_data.h"
 
@@ -2172,7 +2173,7 @@
 //----- (0042777D) --------------------------------------------------------
 void _42777D_CastSpell_UseWand_ShootArrow(int a1, unsigned int uPlayerID, unsigned int a4, __int16 a5, int a6)
 {
-  bool result; // eax@2
+  //bool result; // eax@2
   __int16 v6; // bx@4
   Player *v7; // eax@4
   char v8; // zf@12
@@ -2202,9 +2203,16 @@
 
   a3a = uPlayerID;
   a2a = a1;
-  if ( pParty->bTurnBasedModeOn != 1
-    || (result = pTurnEngine->field_4, pTurnEngine->field_4 != 1) && pTurnEngine->field_4 != 3 )
+  
+  //if ( pParty->bTurnBasedModeOn != 1
+  //  || (result = pTurnEngine->field_4, pTurnEngine->field_4 != 1) && pTurnEngine->field_4 != 3 )
+  if (pParty->bTurnBasedModeOn)
   {
+    if (pTurnEngine->field_4 == 1 || pTurnEngine->field_4 == 3)
+      return;
+  }
+
+
     v6 = a5;
     v7 = &pParty->pPlayers[uPlayerID];
     if ( !(a5 & 0x10) )
@@ -2317,6 +2325,7 @@
           break;
       }
     }
+
     v15 = pStru277;
     if ( v6 & 0x3CA )
     {
@@ -2349,7 +2358,7 @@
       ++v15;
     }
     while ( (signed int)v15 < (signed int)&unk_50C190 );
-    result = pStru277->PushStru277(a2a, a3a, a4, v6, a6);
+    int result = pStru277->PushStru277(a2a, a3a, a4, v6, a6);
     if ( result != -1 )
     {
       if ( v6 & 2 )
@@ -2469,7 +2478,6 @@
         pGUIWindow_Settings->CreateButton(0x231u, 0x95u, 0x40u, 0x4Au, 1, 0, 0x8Fu, 5u, 0x36u, "", 0);
       }
     }
-  }
 }