From 70d56694f2bc49801d62caeee088e7591774d261 Mon Sep 17 00:00:00 2001 From: Stijn Wopereis Date: Tue, 13 Feb 2018 21:28:30 +0100 Subject: [PATCH] Allow offset on fillArm to be in range (#34) --- specializations/HoseSystemFillTriggerInteractive.lua | 4 ++-- specializations/vehicles/strategies/HoseSystemArmStrategy.lua | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/specializations/HoseSystemFillTriggerInteractive.lua b/specializations/HoseSystemFillTriggerInteractive.lua index bc4802b..50ea7ee 100644 --- a/specializations/HoseSystemFillTriggerInteractive.lua +++ b/specializations/HoseSystemFillTriggerInteractive.lua @@ -67,7 +67,7 @@ function HoseSystemFillTriggerInteractive:update(dt) raycast(x, y, z, gp.raycastNode, self, 1) if self.object.lastRaycastDistance ~= 0 then - local isUnderFillplane, planeY = self.object.lastRaycastObject:checkPlaneY(y) + local isUnderFillplane, planeY = self.object.lastRaycastObject:checkPlaneY(y, { x, y, z }) if isUnderFillplane and HoseSystemFillTriggerInteractive:allowFillTypeAffectDirtMask(self.object.lastRaycastObject.fillType) then -- Todo: make this direction based! @@ -186,7 +186,7 @@ function HoseSystemFillTriggerInteractive:fillableObjectRaycastCallback(transfor if vehicle:allowFillType(fillType) then self.object.lastRaycastObject = vehicle self.object.lastRaycastDistance = distance - print("found trailer") + return false end end diff --git a/specializations/vehicles/strategies/HoseSystemArmStrategy.lua b/specializations/vehicles/strategies/HoseSystemArmStrategy.lua index 3449672..1c07082 100644 --- a/specializations/vehicles/strategies/HoseSystemArmStrategy.lua +++ b/specializations/vehicles/strategies/HoseSystemArmStrategy.lua @@ -29,7 +29,8 @@ end -- @param entry -- function HoseSystemArmStrategy:load(xmlFile, key, entry) --- entry.needsTransfer = Utils.getNoNil(getXMLBool(xmlFile, key .. '#needsTransfer'), false) + entry.offset = Utils.getNoNil(getXMLFloat(xmlFile, key .. '#offset'), 0) + self.object.supportedFillTypes = {} local fillTypeCategories = getXMLString(xmlFile, key .. '#supportedFillTypeCategories')