summaryrefslogtreecommitdiffstats
path: root/source/World.cpp
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-10-14 22:10:03 +0200
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-10-14 22:10:03 +0200
commit164f0e7de9b484ca97cec4109739b327cdd421b8 (patch)
treeacf00f873094126d7f947dcc9e7aa61af42f0a6d /source/World.cpp
parentFloody fluid simulator now dries up correctly, too. (diff)
downloadcuberite-164f0e7de9b484ca97cec4109739b327cdd421b8.tar
cuberite-164f0e7de9b484ca97cec4109739b327cdd421b8.tar.gz
cuberite-164f0e7de9b484ca97cec4109739b327cdd421b8.tar.bz2
cuberite-164f0e7de9b484ca97cec4109739b327cdd421b8.tar.lz
cuberite-164f0e7de9b484ca97cec4109739b327cdd421b8.tar.xz
cuberite-164f0e7de9b484ca97cec4109739b327cdd421b8.tar.zst
cuberite-164f0e7de9b484ca97cec4109739b327cdd421b8.zip
Diffstat (limited to '')
-rw-r--r--source/World.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/source/World.cpp b/source/World.cpp
index 68f674ab6..a8ec8b75d 100644
--- a/source/World.cpp
+++ b/source/World.cpp
@@ -2171,11 +2171,14 @@ cFluidSimulator * cWorld::InitializeFluidSimulator(cIniFile & a_IniFile, const c
}
cFluidSimulator * res = NULL;
- // TODO: other fluid simulators
+ bool IsWater = (strcmp(a_FluidName, "Water") == 0); // Used for defaults
if (NoCaseCompare(SimulatorName, "floody") == 0)
{
- // TODO: Floody simulator params
- res = new cFloodyFluidSimulator(this, a_SimulateBlock, a_StationaryBlock, 1, 5);
+ int DefaultFalloff = IsWater ? 1 : 2;
+ int DefaultTickDelay = IsWater ? 5 : 30;
+ int Falloff = a_IniFile.GetValueSetI(SimulatorSectionName, "Falloff", DefaultFalloff);
+ int TickDelay = a_IniFile.GetValueSetI(SimulatorSectionName, "TickDelay", DefaultTickDelay);
+ res = new cFloodyFluidSimulator(this, a_SimulateBlock, a_StationaryBlock, Falloff, TickDelay);
}
else
{
@@ -2184,8 +2187,8 @@ cFluidSimulator * cWorld::InitializeFluidSimulator(cIniFile & a_IniFile, const c
// The simulator name doesn't match anything we have, issue a warning:
LOGWARNING("%s [Physics]:%s specifies an unknown simulator, using the default \"Classic\".", GetIniFileName().c_str(), SimulatorNameKey.c_str());
}
- int DefaultFalloff = (strcmp(a_FluidName, "Water") == 0) ? 1 : 2;
- int DefaultMaxHeight = (strcmp(a_FluidName, "Water") == 0) ? 7 : 6;
+ int DefaultFalloff = IsWater ? 1 : 2;
+ int DefaultMaxHeight = IsWater ? 7 : 6;
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);