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/cAggressiveMonster.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 'source/cAggressiveMonster.cpp')
-rw-r--r-- | source/cAggressiveMonster.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/source/cAggressiveMonster.cpp b/source/cAggressiveMonster.cpp index ff8dc72c1..d52c1c19a 100644 --- a/source/cAggressiveMonster.cpp +++ b/source/cAggressiveMonster.cpp @@ -2,6 +2,7 @@ #include "Vector3f.h"
#include "cPlayer.h"
+#include "MersenneTwister.h"
cAggressiveMonster::cAggressiveMonster()
@@ -58,7 +59,8 @@ void cAggressiveMonster::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)
|