diff options
author | Samuel Barney <samjbarney@gmail.com> | 2013-10-28 23:40:13 +0100 |
---|---|---|
committer | Samuel Barney <samjbarney@gmail.com> | 2013-10-28 23:40:13 +0100 |
commit | d7a490a99205d69abce52c77854fafee52b4e82b (patch) | |
tree | 92e68ff622fc89bd94e11c7ed7fc548ed3129047 /source/World.cpp | |
parent | Got spiders and other mobs respecting night and day for spawning (diff) | |
parent | ProtoProxy: Implemented 1.7.2 status request / response / ping. (diff) | |
download | cuberite-d7a490a99205d69abce52c77854fafee52b4e82b.tar cuberite-d7a490a99205d69abce52c77854fafee52b4e82b.tar.gz cuberite-d7a490a99205d69abce52c77854fafee52b4e82b.tar.bz2 cuberite-d7a490a99205d69abce52c77854fafee52b4e82b.tar.lz cuberite-d7a490a99205d69abce52c77854fafee52b4e82b.tar.xz cuberite-d7a490a99205d69abce52c77854fafee52b4e82b.tar.zst cuberite-d7a490a99205d69abce52c77854fafee52b4e82b.zip |
Diffstat (limited to 'source/World.cpp')
-rw-r--r-- | source/World.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/source/World.cpp b/source/World.cpp index a61c19d63..786d97a4d 100644 --- a/source/World.cpp +++ b/source/World.cpp @@ -444,8 +444,8 @@ void cWorld::Start(void) m_SpawnZ = (double)((m_TickRand.randInt() % 1000) - 500); m_GameMode = eGameMode_Creative; - cIniFile IniFile(m_IniFileName); - if (!IniFile.ReadFile()) + cIniFile IniFile; + if (!IniFile.ReadFile(m_IniFileName)) { LOGWARNING("Cannot read world settings from \"%s\", defaults will be used.", m_IniFileName.c_str()); } @@ -555,7 +555,7 @@ void cWorld::Start(void) // Save any changes that the defaults may have done to the ini file: - if (!IniFile.WriteFile()) + if (!IniFile.WriteFile(m_IniFileName)) { LOGWARNING("Could not write world config to %s", m_IniFileName.c_str()); } @@ -755,9 +755,9 @@ void cWorld::TickMobs(float a_Dt) for (int i = 0; i < ARRAYCOUNT(AllFamilies); i++) { cMonster::eFamily Family = AllFamilies[i]; - int spawnrate = cMonster::GetSpawnRate(Family); + int SpawnDelay = cMonster::GetSpawnDelay(Family); if ( - (m_LastSpawnMonster[Family] > m_WorldAge - spawnrate) || // Not reached the needed tiks before the next round + (m_LastSpawnMonster[Family] > m_WorldAge - SpawnDelay) || // Not reached the needed ticks before the next round MobCensus.IsCapped(Family) ) { @@ -1470,7 +1470,7 @@ bool cWorld::WriteBlockArea(cBlockArea & a_Area, int a_MinBlockX, int a_MinBlock -void cWorld::SpawnItemPickups(const cItems & a_Pickups, double a_BlockX, double a_BlockY, double a_BlockZ, double a_FlyAwaySpeed) +void cWorld::SpawnItemPickups(const cItems & a_Pickups, double a_BlockX, double a_BlockY, double a_BlockZ, double a_FlyAwaySpeed, bool IsPlayerCreated) { MTRand r1; a_FlyAwaySpeed /= 1000; // Pre-divide, so that we don't have to divide each time inside the loop @@ -1482,7 +1482,7 @@ void cWorld::SpawnItemPickups(const cItems & a_Pickups, double a_BlockX, double cPickup * Pickup = new cPickup( a_BlockX, a_BlockY, a_BlockZ, - *itr, SpeedX, SpeedY, SpeedZ + *itr, IsPlayerCreated, SpeedX, SpeedY, SpeedZ ); Pickup->Initialize(this); } @@ -1492,13 +1492,13 @@ 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) +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, bool IsPlayerCreated) { for (cItems::const_iterator itr = a_Pickups.begin(); itr != a_Pickups.end(); ++itr) { cPickup * Pickup = new cPickup( a_BlockX, a_BlockY, a_BlockZ, - *itr, (float)a_SpeedX, (float)a_SpeedY, (float)a_SpeedZ + *itr, IsPlayerCreated, (float)a_SpeedX, (float)a_SpeedY, (float)a_SpeedZ ); Pickup->Initialize(this); } |