]> git.lizzy.rs Git - minetest.git/blobdiff - src/voxel.cpp
working good
[minetest.git] / src / voxel.cpp
index 282ff5e7c6cc12216a7e2e369a1f61e305751d6e..2fd4e7b457ab4bef1f0b64f8cfd38e4ef48dba3f 100644 (file)
@@ -804,8 +804,10 @@ bool VoxelManipulator::flowWater(v3s16 removed_pos,
        if(stoptime != 0)
        {
                u32 timenow = getTimeMs();
-               if(timenow >= stoptime ||
-                               (stoptime < 0x80000000 && timenow > 0x80000000))
+               // Well, it is a bit hard to guess because we don't know the
+               // start time...
+               bool overflow = timenow < stoptime - 100000;
+               if(timenow >= stoptime || overflow)
                {
                        dstream<<"flowWater: stoptime reached"<<std::endl;
                        throw ProcessingLimitException("flowWater stoptime reached");
@@ -891,7 +893,7 @@ void VoxelManipulator::flowWater(
        */
        s32 k = 0;
        if(active_nodes.size() != 0)
-               k = (s32)rand() % (s32)active_nodes.size();
+               k = (s32)myrand() % (s32)active_nodes.size();
 
        // Flow water to active nodes
        for(;;)