diff options
author | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2013-09-24 11:31:57 +0200 |
---|---|---|
committer | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2013-09-24 11:31:57 +0200 |
commit | 21b23ff1e74d6735801f5aaf7ae1659b8c787f7a (patch) | |
tree | d5d606cf69a6f3945bbb8e1c8a80821654a86998 /source/World.cpp | |
parent | Merge pull request #1 from tigerw/bugfixes (diff) | |
parent | Removed some unneeded includes (diff) | |
download | cuberite-21b23ff1e74d6735801f5aaf7ae1659b8c787f7a.tar cuberite-21b23ff1e74d6735801f5aaf7ae1659b8c787f7a.tar.gz cuberite-21b23ff1e74d6735801f5aaf7ae1659b8c787f7a.tar.bz2 cuberite-21b23ff1e74d6735801f5aaf7ae1659b8c787f7a.tar.lz cuberite-21b23ff1e74d6735801f5aaf7ae1659b8c787f7a.tar.xz cuberite-21b23ff1e74d6735801f5aaf7ae1659b8c787f7a.tar.zst cuberite-21b23ff1e74d6735801f5aaf7ae1659b8c787f7a.zip |
Diffstat (limited to 'source/World.cpp')
-rw-r--r-- | source/World.cpp | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/source/World.cpp b/source/World.cpp index 7be83168c..606ef0787 100644 --- a/source/World.cpp +++ b/source/World.cpp @@ -35,8 +35,12 @@ #include "Mobs/Cow.h" #include "Mobs/Creeper.h" #include "Mobs/Enderman.h" +#include "Mobs/EnderDragon.h" #include "Mobs/Ghast.h" -#include "Mobs/Magmacube.h" +#include "Mobs/Giant.h" +#include "Mobs/Horse.h" +#include "Mobs/IronGolem.h" +#include "Mobs/MagmaCube.h" #include "Mobs/Mooshroom.h" #include "Mobs/Ocelot.h" #include "Mobs/Pig.h" @@ -44,13 +48,15 @@ #include "Mobs/Silverfish.h" #include "Mobs/Skeleton.h" #include "Mobs/Slime.h" +#include "Mobs/SnowGolem.h" #include "Mobs/Spider.h" #include "Mobs/Squid.h" #include "Mobs/Villager.h" #include "Mobs/Witch.h" +#include "Mobs/Wither.h" #include "Mobs/Wolf.h" #include "Mobs/Zombie.h" -#include "Mobs/Zombiepigman.h" +#include "Mobs/ZombiePigman.h" #include "OSSupport/MakeDir.h" #include "MersenneTwister.h" @@ -1516,14 +1522,9 @@ void cWorld::SpawnItemPickups(const cItems & a_Pickups, double a_BlockX, double float SpeedX = (float)(a_FlyAwaySpeed * (r1.randInt(1000) - 500)); float SpeedY = 1; float SpeedZ = (float)(a_FlyAwaySpeed * (r1.randInt(1000) - 500)); - - // Pickup doesn't spawn on client without a mid block position. Perhaps the doubles are causing issues? - int MicroX = (int)(floor(a_BlockX) * 32) + 16; - int MicroY = (int)(floor(a_BlockY) * 32) + 16; - int MicroZ = (int)(floor(a_BlockZ) * 32) + 16; cPickup * Pickup = new cPickup( - MicroX, MicroY, MicroZ, + a_BlockX, a_BlockY, a_BlockZ, *itr, SpeedX, SpeedY, SpeedZ ); Pickup->Initialize(this); @@ -1536,16 +1537,10 @@ void cWorld::SpawnItemPickups(const cItems & a_Pickups, double a_BlockX, double void cWorld::SpawnItemPickups(const cItems & a_Pickups, double a_BlockX, double a_BlockY, double a_BlockZ, double a_SpeedX, double a_SpeedY, double a_SpeedZ) { - MTRand r1; for (cItems::const_iterator itr = a_Pickups.begin(); itr != a_Pickups.end(); ++itr) { - // Pickup doesn't spawn on client without a mid block position. Perhaps the doubles are causing issues? - int MicroX = (int)(floor(a_BlockX) * 32) + 16; - int MicroY = (int)(floor(a_BlockY) * 32) + 16; - int MicroZ = (int)(floor(a_BlockZ) * 32) + 16; - cPickup * Pickup = new cPickup( - MicroX, MicroY, MicroZ, + a_BlockX, a_BlockY, a_BlockZ, *itr, (float)a_SpeedX, (float)a_SpeedY, (float)a_SpeedZ ); Pickup->Initialize(this); @@ -2588,8 +2583,12 @@ int cWorld::SpawnMob(double a_PosX, double a_PosY, double a_PosZ, cMonster::eTyp case cMonster::mtCow: Monster = new cCow(); break; case cMonster::mtCreeper: Monster = new cCreeper(); break; case cMonster::mtEnderman: Monster = new cEnderman(); break; + case cMonster::mtEnderDragon: Monster = new cEnderDragon(); break; case cMonster::mtGhast: Monster = new cGhast(); break; - case cMonster::mtMagmaCube: Monster = new cMagmacube(Size); break; + case cMonster::mtGiant: Monster = new cGiant(); break; + case cMonster::mtHorse: Monster = new cHorse(); break; + case cMonster::mtIronGolem: Monster = new cIronGolem(); break; + case cMonster::mtMagmaCube: Monster = new cMagmaCube(Size); break; case cMonster::mtMooshroom: Monster = new cMooshroom(); break; case cMonster::mtOcelot: Monster = new cOcelot(); break; case cMonster::mtPig: Monster = new cPig(); break; @@ -2597,13 +2596,15 @@ int cWorld::SpawnMob(double a_PosX, double a_PosY, double a_PosZ, cMonster::eTyp case cMonster::mtSilverfish: Monster = new cSilverfish(); break; case cMonster::mtSkeleton: Monster = new cSkeleton(); break; case cMonster::mtSlime: Monster = new cSlime(Size); break; + case cMonster::mtSnowGolem: Monster = new cSnowGolem(); break; case cMonster::mtSpider: Monster = new cSpider(); break; case cMonster::mtSquid: Monster = new cSquid(); break; case cMonster::mtVillager: Monster = new cVillager(); break; case cMonster::mtWitch: Monster = new cWitch(); break; + case cMonster::mtWither: Monster = new cWither(); break; case cMonster::mtWolf: Monster = new cWolf(); break; case cMonster::mtZombie: Monster = new cZombie(); break; - case cMonster::mtZombiePigman: Monster = new cZombiepigman(); break; + case cMonster::mtZombiePigman: Monster = new cZombiePigman(); break; default: { |