summaryrefslogtreecommitdiffstats
path: root/source/World.cpp
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-10-15 22:16:43 +0200
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-10-15 22:16:43 +0200
commitf9dab57d8b4b98ec0f624212452c48769c8441d1 (patch)
treed62abda0578d60686466c04c15416646c2e6c643 /source/World.cpp
parentFloody fluid sim: reads params from world.ini; water and lava react together into cobblestone / stone / obsidian (diff)
downloadcuberite-f9dab57d8b4b98ec0f624212452c48769c8441d1.tar
cuberite-f9dab57d8b4b98ec0f624212452c48769c8441d1.tar.gz
cuberite-f9dab57d8b4b98ec0f624212452c48769c8441d1.tar.bz2
cuberite-f9dab57d8b4b98ec0f624212452c48769c8441d1.tar.lz
cuberite-f9dab57d8b4b98ec0f624212452c48769c8441d1.tar.xz
cuberite-f9dab57d8b4b98ec0f624212452c48769c8441d1.tar.zst
cuberite-f9dab57d8b4b98ec0f624212452c48769c8441d1.zip
Diffstat (limited to '')
-rw-r--r--source/World.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/source/World.cpp b/source/World.cpp
index a8ec8b75d..9b8f3eccb 100644
--- a/source/World.cpp
+++ b/source/World.cpp
@@ -287,15 +287,14 @@ cWorld::cWorld( const AString & a_WorldName )
m_BlockTickQueueCopy.reserve(1000);
// Simulators:
+ m_SimulatorManager = new cSimulatorManager();
m_WaterSimulator = InitializeFluidSimulator(IniFile, "Water", E_BLOCK_WATER, E_BLOCK_STATIONARY_WATER);
m_LavaSimulator = InitializeFluidSimulator(IniFile, "Lava", E_BLOCK_LAVA, E_BLOCK_STATIONARY_LAVA);
m_SandSimulator = new cSandSimulator(this);
m_FireSimulator = new cFireSimulator(this);
m_RedstoneSimulator = new cRedstoneSimulator(this);
- m_SimulatorManager = new cSimulatorManager();
- m_SimulatorManager->RegisterSimulator(m_WaterSimulator, 6);
- m_SimulatorManager->RegisterSimulator(m_LavaSimulator, 12);
+ // Water and Lava simulators get registered in InitializeFluidSimulator()
m_SimulatorManager->RegisterSimulator(m_SandSimulator, 1);
m_SimulatorManager->RegisterSimulator(m_FireSimulator, 10);
m_SimulatorManager->RegisterSimulator(m_RedstoneSimulator, 1);
@@ -2172,6 +2171,7 @@ cFluidSimulator * cWorld::InitializeFluidSimulator(cIniFile & a_IniFile, const c
cFluidSimulator * res = NULL;
bool IsWater = (strcmp(a_FluidName, "Water") == 0); // Used for defaults
+ int Rate = 1;
if (NoCaseCompare(SimulatorName, "floody") == 0)
{
int DefaultFalloff = IsWater ? 1 : 2;
@@ -2192,8 +2192,11 @@ cFluidSimulator * cWorld::InitializeFluidSimulator(cIniFile & a_IniFile, const c
int Falloff = a_IniFile.GetValueSetI(SimulatorSectionName, "Falloff", DefaultFalloff);
int MaxHeight = a_IniFile.GetValueSetI(SimulatorSectionName, "MaxHeight", DefaultMaxHeight);
res = new cClassicFluidSimulator(this, a_SimulateBlock, a_StationaryBlock, MaxHeight, Falloff);
+ Rate = IsWater ? 6 : 12;
}
+ m_SimulatorManager->RegisterSimulator(res, Rate);
+
return res;
}