fix(ejerskab): jord-bundne kortanlæg (boughtWithFarmland / ejer 15) er gårdens når jorden under dem er købt — Dakotas BGA500kw på jordlod 69 (v1.17.7.0)

This commit is contained in:
2026-09-24 04:57:12 +02:00
parent b603bd7765
commit c814557ae1
8 changed files with 84 additions and 13 deletions
+4
View File
@@ -50,7 +50,11 @@ local function getProductionPoint(placeable)
return placeable.spec_productionPoint ~= nil and placeable.spec_productionPoint.productionPoint or nil
end
-- Fælles ejerregel (ADPrices): egen ejer eller jord-bundet kortanlæg på gårdens jord.
local function isOwnedBy(placeable, farmId)
if ADPrices ~= nil and ADPrices.isOwnedBy ~= nil then
return ADPrices.isOwnedBy(placeable, farmId)
end
if placeable.getOwnerFarmId ~= nil then
local ok, owner = pcall(placeable.getOwnerFarmId, placeable)
return ok and owner == farmId