Add edge flood behaviour for land ground objects with no foundations

pull/678/head
Jonathan G Rennison 1 month ago
parent 109d31a350
commit c8709a9623

@ -304,7 +304,7 @@
<tr><td>use_land_ground</td><td>0 or 1</td><td>
Sets whether to use the underlying ground as the object ground sprite, ignoring the ground sprite provided in the sprite layout.<br />
When enabled, the ground sprite will be bare ground, grass, snow, desert, etc. as if it were a clear ground tile.<br />
In edge foundation mode, the ground may be coast/shore when flooded.
In edge foundation mode, or when foundations are disabled, the ground may be coast/shore when flooded.
</td></tr>
<tr><td>edge_foundation_mode</td><td>[mode0, mode1, mode2, mode3]</td><td>
Enables edge foundation mode for the object.<br />

@ -583,7 +583,7 @@
<h4 id="object_use_land_ground">Object uses land ground sprite (mappable property: object_use_land_ground)</h4>
<p>This property sets whether to use the underlying ground as the object ground sprite, ignoring the ground sprite provided in the sprite layout.<br />
When enabled, the ground sprite will be bare ground, grass, snow, desert, etc. as if it were a clear ground tile.<br />
In edge foundation mode, the ground may be coast/shore when flooded.<br />
In edge foundation mode, or when foundations are disabled, the ground may be coast/shore when flooded.<br />
The property length is 1 byte. 0 is disabled (default). 1 is enabled.</p>
<p>This is indicated by the feature name: <font face="monospace">action0_object_use_land_ground</font>, version 1</p>
<h4 id="object_edge_foundation_mode">Enable object edge foundation mode (mappable property: object_edge_foundation_mode)</h4>

@ -1247,6 +1247,11 @@ void DoFloodTile(TileIndex target)
SetObjectGroundTypeDensity(target, OBJECT_GROUND_SHORE, 3);
MarkTileDirtyByTile(target, VMDF_NOT_MAP_MODE);
flooded = true;
} else if ((spec->ctrl_flags & OBJECT_CTRL_FLAG_USE_LAND_GROUND) && (spec->flags & OBJECT_FLAG_HAS_NO_FOUNDATION)) {
SetWaterClass(target, WATER_CLASS_SEA);
SetObjectGroundTypeDensity(target, OBJECT_GROUND_SHORE, 3);
MarkTileDirtyByTile(target, VMDF_NOT_MAP_MODE);
flooded = true;
}
break;
}

Loading…
Cancel
Save