diff options
author | mtilden@gmail.com <mtilden@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2011-12-26 10:09:47 +0100 |
---|---|---|
committer | mtilden@gmail.com <mtilden@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2011-12-26 10:09:47 +0100 |
commit | c7fa610be3b6e072d3da4611f6de72390ebbf446 (patch) | |
tree | eaa1e1d08d9136c78228ec067f4d41b1d33ef320 /source/cPassiveMonster.cpp | |
parent | - Added timer to cPlayer PlayerListItem because sending the packets like minecraft does (every tick per player) is 20 pps per client to each client and was causing Kicks for having too high of a packet queue (diff) | |
download | cuberite-c7fa610be3b6e072d3da4611f6de72390ebbf446.tar cuberite-c7fa610be3b6e072d3da4611f6de72390ebbf446.tar.gz cuberite-c7fa610be3b6e072d3da4611f6de72390ebbf446.tar.bz2 cuberite-c7fa610be3b6e072d3da4611f6de72390ebbf446.tar.lz cuberite-c7fa610be3b6e072d3da4611f6de72390ebbf446.tar.xz cuberite-c7fa610be3b6e072d3da4611f6de72390ebbf446.tar.zst cuberite-c7fa610be3b6e072d3da4611f6de72390ebbf446.zip |
Diffstat (limited to '')
-rw-r--r-- | source/cPassiveMonster.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/source/cPassiveMonster.cpp b/source/cPassiveMonster.cpp index bbfbc83ed..1f11484ef 100644 --- a/source/cPassiveMonster.cpp +++ b/source/cPassiveMonster.cpp @@ -1,4 +1,5 @@ #include "cPassiveMonster.h"
+#include "MersenneTwister.h"
cPassiveMonster::cPassiveMonster()
@@ -24,7 +25,8 @@ void cPassiveMonster::Tick(float a_Dt) if(m_SeePlayerInterval > 1)
{
- int rem = rand() % 3 + 1; //check most of the time but miss occasionally
+ MTRand r1;
+ int rem = r1.randInt() % 3 + 1; //check most of the time but miss occasionally
m_SeePlayerInterval = 0.0;
if(rem >= 2) {
|