diff mm7_4.cpp @ 816:cfc65feef029

* Player Recovery Times * Player Attack fixes * Debug log to timers
author Nomad
date Tue, 26 Mar 2013 12:40:27 +0200
parents 7bb33867d2cb
children 9359c114f98c
line wrap: on
line diff
--- a/mm7_4.cpp	Tue Mar 26 06:40:04 2013 +0200
+++ b/mm7_4.cpp	Tue Mar 26 12:40:27 2013 +0200
@@ -2377,8 +2377,8 @@
   Player **v16; // esi@43
   Player *v17; // edi@44
   double v18; // st7@44
-  float v19; // ST28_4@48
-  double v20; // ST38_8@48
+  //float v19; // ST28_4@48
+  //double v20; // ST38_8@48
   Player *v21; // esi@51
   signed int v22; // edi@53
   int v23; // eax@59
@@ -2418,7 +2418,7 @@
   //int v57; // [sp-4h] [bp-34h]@18
   int v58; // [sp-4h] [bp-34h]@33
   int v59; // [sp-4h] [bp-34h]@55
-  unsigned int v60; // [sp+10h] [bp-20h]@1
+  //unsigned int v60; // [sp+10h] [bp-20h]@1
   unsigned int v61; // [sp+14h] [bp-1Ch]@1
   Player **v62; // [sp+14h] [bp-1Ch]@50
   //unsigned int a2; // [sp+18h] [bp-18h]@1
@@ -2427,7 +2427,7 @@
 
   //a2 = pParty->uCurrentHour;
   v61 = pParty->uDaysPlayed;
-  v60 = pEventTimer->uTimeElapsed;
+  //auto prev_time = pEventTimer->uTimeElapsed;
   pParty->uTimePlayed += pEventTimer->uTimeElapsed;
   v0 = (signed __int64)(pParty->uTimePlayed * 0.234375) / 60;
   v1 = v0;
@@ -2547,13 +2547,13 @@
   }
   _493938_regenerate();
   v65 = 4;
-  a2a = v60;
-  if ( pParty->uFlags2 & 2 )
-  {
-    v19 = (double)(signed int)v60 * 0.5;
-    v20 = v19 + 6.7553994e15;
-    a2a = LODWORD(v20);
-    if ( SLODWORD(v20) <= 0 )
+  a2a = pEventTimer->uTimeElapsed;
+  if ( pParty->uFlags2 & PARTY_FLAGS_2_RUNNING )
+  {
+    //v19 = (double)(signed int)prev_time * 0.5;
+    //v20 = v19 + 6.7553994e15;
+    a2a *= 0.5f;
+    if (a2a < 1)
       a2a = 1;
   }
   v62 = &pPlayers[1];
@@ -2581,7 +2581,7 @@
     v23 = (int)&v21->field_E0;
     if ( v21->field_E0 )
     {
-      v24 = *(int *)v23 - v60;
+      v24 = *(int *)v23 - pEventTimer->uTimeElapsed;
       if ( v24 > 0 )
       {
         *(int *)v23 = v24;
@@ -2595,7 +2595,7 @@
     v25 = (int)&v21->field_E4;
     if ( v21->field_E4 )
     {
-      v26 = *(int *)v25 - v60;
+      v26 = *(int *)v25 - pEventTimer->uTimeElapsed;
       if ( v26 > 0 )
       {
         *(int *)v25 = v26;
@@ -2609,7 +2609,7 @@
     v27 = (int)&v21->field_E8;
     if ( v21->field_E8 )
     {
-      v28 = *(int *)v27 - v60;
+      v28 = *(int *)v27 - pEventTimer->uTimeElapsed;
       if ( v28 > 0 )
       {
         *(int *)v27 = v28;
@@ -2623,7 +2623,7 @@
     v29 = (int)&v21->field_EC;
     if ( v21->field_EC )
     {
-      v30 = *(int *)v29 - v60;
+      v30 = *(int *)v29 - pEventTimer->uTimeElapsed;
       if ( v30 > 0 )
       {
         *(int *)v29 = v30;
@@ -2637,7 +2637,7 @@
     v31 = (int)&v21->field_F0;
     if ( v21->field_F0 )
     {
-      v32 = *(int *)v31 - v60;
+      v32 = *(int *)v31 - pEventTimer->uTimeElapsed;
       if ( v32 > 0 )
       {
         *(int *)v31 = v32;
@@ -2651,7 +2651,7 @@
     v33 = (int)&v21->field_F4;
     if ( v21->field_F4 )
     {
-      v34 = *(int *)v33 - v60;
+      v34 = *(int *)v33 - pEventTimer->uTimeElapsed;
       if ( v34 > 0 )
       {
         *(int *)v33 = v34;
@@ -2665,7 +2665,7 @@
     v35 = (int)&v21->field_F8;
     if ( v21->field_F8 )
     {
-      v36 = *(int *)v35 - v60;
+      v36 = *(int *)v35 - pEventTimer->uTimeElapsed;
       if ( v36 > 0 )
       {
         *(int *)v35 = v36;
@@ -2679,7 +2679,7 @@
     v37 = (int)&v21->field_FC;
     if ( v21->field_FC )
     {
-      v38 = *(int *)v37 - v60;
+      v38 = *(int *)v37 - pEventTimer->uTimeElapsed;
       if ( v38 > 0 )
       {
         *(int *)v37 = v38;
@@ -2693,7 +2693,7 @@
     v39 = (int)&v21->field_100;
     if ( v21->field_100 )
     {
-      v40 = *(int *)v39 - v60;
+      v40 = *(int *)v39 - pEventTimer->uTimeElapsed;
       if ( v40 > 0 )
       {
         *(int *)v39 = v40;
@@ -2707,7 +2707,7 @@
     v41 = (int)&v21->field_104;
     if ( v21->field_104 )
     {
-      v42 = *(int *)v41 - v60;
+      v42 = *(int *)v41 - pEventTimer->uTimeElapsed;
       if ( v42 > 0 )
       {
         *(int *)v41 = v42;