From 724cc34e8c6f78cbf71db3c6554bc51d7f0b44ab Mon Sep 17 00:00:00 2001 From: loki79uk Date: Fri, 27 May 2022 17:22:33 +0100 Subject: [PATCH] Make bushes mowable Added permanent removal of bushes and foliage with mower --- GrassMowing.lua | 13 ++++++++++++- modDesc.xml | 4 ++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/GrassMowing.lua b/GrassMowing.lua index fb54bc0..384f9cf 100644 --- a/GrassMowing.lua +++ b/GrassMowing.lua @@ -48,6 +48,17 @@ function GrassMowing:update(dt) end end + if g_currentMission.foliageSystem ~= nil then + local decoFoliages = g_currentMission.foliageSystem:getDecoFoliages() + + for _, decoFoliage in pairs(decoFoliages) do + if decoFoliage.layerName=="decoFoliage" or decoFoliage.layerName=="decoBush" then + decoFoliage.mowable = true + print("MOWABLE: " .. decoFoliage.layerName ) + end + end + end + self.initialised = true end -end \ No newline at end of file +end diff --git a/modDesc.xml b/modDesc.xml index aa21ace..d4e7993 100644 --- a/modDesc.xml +++ b/modDesc.xml @@ -1,7 +1,7 @@ - + loki_79 - 1.0.0.0 + 1.1.0.0 <en>Grass Mowing</en> <de>Gras Mähen</de>