stijnwop / manureSystem

Manure System modification for Farming Simulator 2022
GNU General Public License v3.0
97 stars 58 forks source link

Overloading via Funnel is broken with more than... #137

Closed Mantikor83 closed 3 years ago

Mantikor83 commented 3 years ago

Hi, actually the function to overload liquid manure from Trailers like the Kotte-Trailer and other Mod-Trailers is broken. When using 2 or more trailers to bring the manure to the field the funnel is working to overload the first round well, when then the trailer arrives the second time (after another trailer was used by the manure barrel) on the field the option to start the pump is not given at the manure barrel. The hose connection still works. When you reset the trailer in this situation everything is fine again. So it seems, that there is a issue with the reset of the status of the Trailers. It feels like it keeps the status "is pumping", so that the manure barrel can't start the pump again (don't get the option to do so).

This makes the manure system nearly useless in many game situations, so maybe there is a chance to fix it.

This Problems occurs in SP and MP and was approved by many users into the community, not only me.

Justice-Molton commented 3 years ago

I can agree this behavior. We actually try if it's working with only one trailer. Because we need to get the work done :-)

Monteur1 commented 3 years ago

I have a solution for this issue. In my opinion, the issue comes form the "ManureSystemDockStrategy.lua" at the "FS19_manureSystem\src\misc\strategies\connectors"-folder. The filling from the "self.dockingArmObjects"-Table is not correct. Overwrite the code from line 321 It´s the ManureSystemDockStrategy:dockingArmEnteredTriggerCallback function. Overwrite the function with the following code:

function ManureSystemDockStrategy:dockingArmEnteredTriggerCallback(triggerId, otherActorId, onEnter, onLeave, onStay, otherShapeId) if otherActorId ~= 0 then local object = gcurrentMission:getNodeObject(otherActorId) if object ~= nil and object.getFillArms ~= nil then if onEnter then if self.dockingArmObjectsDelayedDelete[object] ~= nil then self.dockingArmObjectsDelayedDelete[object] = nil else -- Geändert Monteur -- if #self.dockingArmObjects == 0 or #self.dockingArmObjects == nil then table.insert(self.dockingArmObjects, object) else for , dockingArmObject in pairs(self.dockingArmObjects) do if object ~= dockingArmObject then table.insert(self.dockingArmObjects, object) end end end end else self.dockingArmObjectsDelayedDelete[object] = g_currentMission.time + ManureSystemDockStrategy.DEFORMATION_RESET_TIME end

self.object:raiseActive() end end end

I tested it with transporter-funnels and stationary funnels. Worked with no issues anymore. Bye

stijnwop commented 3 years ago

Hey Monteur1, thanks for spending time on finding the issue. It's much appreciated!

Check my last commit, that also prevents double inserts. See issue #55. Have been investigating last weekend too.

Monteur1 commented 3 years ago

Hey stijnwop, no problem, it´s always a pleasure to study your code. Great programing. Nice to hear, that you still improve the manureSystem. Thanks for all your mods. Bye

Mantikor83 commented 3 years ago

Great Job, thanks a lot!

stijnwop commented 3 years ago

@Mantikor83 confirmed that it's working?

Mantikor83 commented 3 years ago

Test in progress, will let you know when I have made a bunch of rounds. =)

Mantikor83 commented 3 years ago

Yes I can confirm that it is working now in single player. Multiplayer will be tested with the next chance to do it.

BR

Manti

stijnwop commented 3 years ago

And found anything in MP? @Mantikor83

Mantikor83 commented 3 years ago

For various reasons our MP evening was canceled the last weeks, so I had not the chance to test. =/

Maybe someone else? In SP it worked fine for over 20 IG hours now.

Snickers125 commented 3 years ago

I call it a FIX! tested in hosted MP and on a dedicated server