diff options
| author | Kris Parker | 2009-11-18 11:36:00 +0000 |
|---|---|---|
| committer | Kris Parker | 2009-11-18 11:36:00 +0000 |
| commit | d96c73f6acc9abc735be89709a02938c832c87b2 (patch) | |
| tree | c872d5c3c4c45ced21f184e3460013a96a59599c /BlockCondition.cpp | |
| parent | f58374b74b2bc77a71118889b57c46f943ebae02 (diff) | |
| download | stonesense-d96c73f6acc9abc735be89709a02938c832c87b2.tar.gz stonesense-d96c73f6acc9abc735be89709a02938c832c87b2.tar.bz2 stonesense-d96c73f6acc9abc735be89709a02938c832c87b2.tar.xz | |
support for water-level based buildings
Diffstat (limited to 'BlockCondition.cpp')
| -rw-r--r-- | BlockCondition.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/BlockCondition.cpp b/BlockCondition.cpp index 11c1008..12a8b82 100644 --- a/BlockCondition.cpp +++ b/BlockCondition.cpp @@ -345,3 +345,17 @@ bool HaveFloorCondition::Matches(Block* b) {
return (b->floorType > 0);
}
+
+FluidBelowCondition::FluidBelowCondition(const char* strValue)
+ : BlockCondition()
+{
+ this->value = atoi( strValue );
+}
+
+bool FluidBelowCondition::Matches(Block* b)
+{
+ Block* bLow = b->ownerSegment->getBlockRelativeTo( b->x, b->y, b->z, eBelow );
+ if (!bLow)
+ return false;
+ return (bLow->water.index >= this->value);
+}
|
