fix(tømmevogn): sæt retning på CP-tømmejobbets positioner når CP ikke selv nåede det — 'Angle missing' afviste tømmevognen til F15 i en time (v1.42.6.0)
This commit is contained in:
@@ -591,6 +591,21 @@ function ADCpBridge.startUnloader(vehicle, fieldX, fieldZ, waitX, waitZ, station
|
||||
if params ~= nil then
|
||||
if params.fieldPosition ~= nil then pcall(function() params.fieldPosition:setPosition(fieldX, fieldZ) end) end
|
||||
if params.startPosition ~= nil then pcall(function() params.startPosition:setPosition(waitX, waitZ) end) end
|
||||
-- positioner med retning: CP's applyCurrentState sætter retningen, men fejler den (pcall ovenfor) bliver den
|
||||
-- aldrig sat, og spillet afviser jobbet med "Angle missing" (in-game 27/9 F15, hvert 5. min i en time)
|
||||
pcall(function()
|
||||
local dirX, _, dirZ = localDirectionToWorld(vehicle.rootNode, 0, 0, 1)
|
||||
local angle = MathUtil.getYRotationFromDirection(dirX, dirZ)
|
||||
for _, position in ipairs({params.startPosition, params.fieldUnloadPosition}) do
|
||||
if position ~= nil and position.getAngle ~= nil and position:getAngle() == nil then
|
||||
if position.getPosition ~= nil and select(1, position:getPosition()) == nil then
|
||||
local vx, _, vz = getWorldTranslation(vehicle.rootNode)
|
||||
position:setPosition(vx, vz)
|
||||
end
|
||||
position:setAngle(angle)
|
||||
end
|
||||
end
|
||||
end)
|
||||
if params.useGiantsUnload ~= nil then pcall(function() params.useGiantsUnload:setValue(true) end) end
|
||||
end
|
||||
pcall(function() job:setValues() end)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8" standalone="no"?>
|
||||
<modDesc descVersion="107">
|
||||
<author>masterdraco</author>
|
||||
<version>1.42.5.0</version>
|
||||
<version>1.42.6.0</version>
|
||||
<title>
|
||||
<en>AD Smart Pickup</en>
|
||||
</title>
|
||||
|
||||
Reference in New Issue
Block a user