Skip to content

Commit

Permalink
Update for FS patch 1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
Nekzuris committed Dec 14, 2024
1 parent 5e89416 commit 86e3e23
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 48 deletions.
28 changes: 15 additions & 13 deletions CropDestructionAnywhere.lua
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
CropDestructionAnywhere = {}

function CropDestructionAnywhere:update(dt, allowFoliageDestruction)
if allowFoliageDestruction then
local hasContact = self.wheel.physics.contact ~= WheelContactType.NONE
local doFruitDestruction = hasContact and not self.isCareWheel
if doFruitDestruction then
for _, destructionNode in ipairs(self.destructionNodes) do
local repr = self.wheel.repr
local width = 0.5 * destructionNode.width
local length = math.min(0.5, 0.5 * destructionNode.width)
local xShift, yShift, zShift = localToLocal(destructionNode.node, repr, 0, 0, 0)
local x0, _, z0 = localToWorld(repr, xShift + width, yShift, zShift - length)
local x1, _, z1 = localToWorld(repr, xShift - width, yShift, zShift - length)
local x2, _, z2 = localToWorld(repr, xShift + width, yShift, zShift + length)
self:destroyFruitArea(x0, z0, x1, z1, x2, z2)
if g_server ~= nil or self.vehicle.currentUpdateDistance < WheelDestruction.MAX_UPDATE_DISTANCE then
if allowFoliageDestruction then
local hasContact = self.wheel.physics.contact ~= WheelContactType.NONE
local doFruitDestruction = hasContact and not self.isCareWheel
if doFruitDestruction then
for _, destructionNode in ipairs(self.destructionNodes) do
local repr = self.wheel.repr
local width = 0.5 * destructionNode.width
local length = math.min(0.5, 0.5 * destructionNode.width)
local xShift, yShift, zShift = localToLocal(destructionNode.node, repr, 0, 0, 0)
local x0, _, z0 = localToWorld(repr, xShift + width, yShift, zShift - length)
local x1, _, z1 = localToWorld(repr, xShift - width, yShift, zShift - length)
local x2, _, z2 = localToWorld(repr, xShift + width, yShift, zShift + length)
self:destroyFruitArea(x0, z0, x1, z1, x2, z2)
end
end
end
end
Expand Down
82 changes: 47 additions & 35 deletions modDesc.xml
Original file line number Diff line number Diff line change
@@ -1,35 +1,47 @@
<?xml version="1.0" encoding="utf-8" standalone="no" ?>
<modDesc descVersion="93">
<author>Nekzuris</author>
<version>1.0.0.0</version>
<title>
<en>Crop Destruction Anywhere</en>
<fr>Destruction Des Cultures Partout</fr>
<de>Ernteschäden Überall</de>
</title>
<description>
<en><![CDATA[
This mod removes the magical crop protection from fields you don't own for a more realistic experience.
Bug reports and translations on GitHub:
https://github.com/Nekzuris/FS25_CropDestructionAnywhere
]]></en>
<fr><![CDATA[
Ce mod supprime la protection magique des cultures sur les champs que vous ne possédez pas pour une expérience plus réaliste.
Bugs et traductions sur GitHub :
https://github.com/Nekzuris/FS25_CropDestructionAnywhere
]]></fr>
<de><![CDATA[
Dieser Mod entfernt den magischen Ernteschutz auf Feldern, die dir nicht gehören, für ein realistischeres Spielerlebnis.
Fehlermeldungen und Übersetzungen auf GitHub:
https://github.com/Nekzuris/FS25_CropDestructionAnywhere
]]></de>
</description>
<multiplayer supported="true"/>
<iconFilename>icon_CropDestructionAnywhere.dds</iconFilename>
<extraSourceFiles>
<sourceFile filename="CropDestructionAnywhere.lua"/>
</extraSourceFiles>
</modDesc>
<?xml version="1.0" encoding="utf-8" standalone="no" ?>
<modDesc descVersion="94">
<author>Nekzuris</author>
<version>1.0.0.1</version>
<title>
<en>Crop Destruction Anywhere</en>
<fr>Destruction Des Cultures Partout</fr>
<de>Ernteschäden Überall</de>
</title>
<description>
<en><![CDATA[
This mod removes the magical crop protection from fields you don't own for a more realistic experience.
Changelog:
v1.0.0.1
- Update for FS patch 1.4
Bug reports and translations on GitHub:
https://github.com/Nekzuris/FS25_CropDestructionAnywhere
]]></en>
<fr><![CDATA[
Ce mod supprime la protection magique des cultures sur les champs que vous ne possédez pas pour une expérience plus réaliste.
Changelog :
v1.0.0.1
- Mise à jour pour FS patch 1.4
Bugs et traductions sur GitHub :
https://github.com/Nekzuris/FS25_CropDestructionAnywhere
]]></fr>
<de><![CDATA[
Dieser Mod entfernt den magischen Ernteschutz auf Feldern, die dir nicht gehören, für ein realistischeres Spielerlebnis.
Changelog:
v1.0.0.1
- Update für FS Patch 1.4
Fehlermeldungen und Übersetzungen auf GitHub:
https://github.com/Nekzuris/FS25_CropDestructionAnywhere
]]></de>
</description>
<multiplayer supported="true"/>
<iconFilename>icon_CropDestructionAnywhere.dds</iconFilename>
<extraSourceFiles>
<sourceFile filename="CropDestructionAnywhere.lua"/>
</extraSourceFiles>
</modDesc>

0 comments on commit 86e3e23

Please sign in to comment.