fix(salg): fremmede produktioner (kortets mejeri, ejer 0) er salgssteder; kun gårdens egne fabrikker/stalde udelukkes; '>=' i stedet for '≥' (mangler i fonten) (v1.17.1.0)
This commit is contained in:
@@ -75,13 +75,30 @@ function ADPrices.isSellingStation(station)
|
||||
if station.isSellingPoint ~= true or station.hideFromPricesMenu then
|
||||
return false
|
||||
end
|
||||
-- Afleveringer til GÅRDENS EGNE fabrikker/stalde er ikke salg. En fremmed produktion (fx kortets
|
||||
-- mejeri, ejer 0) køber varen og er et rigtigt salgssted. Ukendt ejer = regnes som egen.
|
||||
local placeable = station.owningPlaceable
|
||||
if placeable ~= nil and (placeable.spec_productionPoint ~= nil or placeable.getHusbandryFillLevel ~= nil) then
|
||||
return false
|
||||
return not ADPrices.isOwnedByPlayer(placeable)
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
function ADPrices.isOwnedByPlayer(placeable)
|
||||
local owner = nil
|
||||
if placeable.getOwnerFarmId ~= nil then
|
||||
local ok, value = pcall(placeable.getOwnerFarmId, placeable)
|
||||
if ok then owner = value end
|
||||
elseif placeable.ownerFarmId ~= nil then
|
||||
owner = placeable.ownerFarmId
|
||||
end
|
||||
if owner == nil then
|
||||
return true
|
||||
end
|
||||
local farmId = g_currentMission ~= nil and g_currentMission.getFarmId ~= nil and g_currentMission:getFarmId() or 1
|
||||
return owner == farmId
|
||||
end
|
||||
|
||||
local function getCurrentPeriod()
|
||||
local environment = g_currentMission ~= nil and g_currentMission.environment or nil
|
||||
return environment ~= nil and environment.currentPeriod or nil
|
||||
|
||||
@@ -115,7 +115,7 @@
|
||||
<text name="spu_flow_noSource" text="(ingen kilde)"/>
|
||||
<text name="spu_flow_noTarget" text="(intet mål)"/>
|
||||
<text name="spu_flow_noVehicle" text="(ingen traktor)"/>
|
||||
<text name="spu_flow_ruleOut" text="pris ≥ %d %%, lager > %d %%"/>
|
||||
<text name="spu_flow_ruleOut" text="pris >= %d %%, lager > %d %%"/>
|
||||
<text name="spu_flow_round" text="runde"/>
|
||||
<text name="spu_flow_ruleIn" text="behov"/>
|
||||
<text name="spu_flow_ruleInLoops" text="behov, %d ture"/>
|
||||
|
||||
@@ -115,7 +115,7 @@
|
||||
<text name="spu_flow_noSource" text="(no source)"/>
|
||||
<text name="spu_flow_noTarget" text="(no target)"/>
|
||||
<text name="spu_flow_noVehicle" text="(no tractor)"/>
|
||||
<text name="spu_flow_ruleOut" text="price ≥ %d %%, storage > %d %%"/>
|
||||
<text name="spu_flow_ruleOut" text="price >= %d %%, storage > %d %%"/>
|
||||
<text name="spu_flow_round" text="round"/>
|
||||
<text name="spu_flow_ruleIn" text="need"/>
|
||||
<text name="spu_flow_ruleInLoops" text="need, %d loops"/>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8" standalone="no"?>
|
||||
<modDesc descVersion="107">
|
||||
<author>masterdraco</author>
|
||||
<version>1.17.0.0</version>
|
||||
<version>1.17.1.0</version>
|
||||
<title>
|
||||
<en>AD Smart Pickup</en>
|
||||
</title>
|
||||
|
||||
Reference in New Issue
Block a user