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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user