Jump to content

fix for manual compilation on Linux


PixelPirate
 Share

Recommended Posts

sorry just remplace this:

[== c++ ==]
uint64 diff = 0;      (currTime - g_SystemTickTime).msec(diff);         //lets calculate current world time      uint32 iRes = uint32(diff % UI64LIT(0x00000000FFFFFFFF));      return iRes;  }

lines 62 to 68

by this : http://paste2.org/p/1508992

sorry I have not a diff or patch on hand because I fix this problem there are a lot of time:)

thx to y vlad

Link to comment
Share on other sites

If you have mangos - you surely will have git, and hence you can use git diff to get the diff :)

If I understood you correctly:

diff --git a/src/shared/Util.cpp b/src/shared/Util.cpp
index 6bbdfa6..dd6fc95 100644
--- a/src/shared/Util.cpp
+++ b/src/shared/Util.cpp
@@ -54,16 +54,24 @@ uint32 WorldTimer::getMSTime()

uint32 WorldTimer::getMSTime_internal(bool savetime /*= false*/)
{
-    //get current time
-    const ACE_Time_Value currTime = ACE_OS::gettimeofday();
-    //calculate time diff between two world ticks
-    //special case: curr_time < old_time - we suppose that our time has not ticked at all
-    //this should be constant value otherwise it is possible that our time can start ticking backwards until next world tick!!!
    uint64 diff = 0;
-    (currTime - g_SystemTickTime).msec(diff);
+    //regular case: curr_time >= old_time
+    if(currTime > g_SystemTickTime)
+        diff = (currTime - g_SystemTickTime).msec();
+
+    //reset last system time value
+    if(savetime)
+        g_SystemTickTime = currTime;

    //lets calculate current world time
-    uint32 iRes = uint32(diff % UI64LIT(0x00000000FFFFFFFF));
+    uint32 iRes = m_iTime;
+    //normalize world time
+    const uint32 tmp = uint32(0xFFFFFFFF) - iRes;
+    if(tmp < diff)
+        iRes = diff - tmp;
+    else
+        iRes += diff;
+
    return iRes;
}

Link to comment
Share on other sites

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use