Skip to content

Commit

Permalink
Possible animation fix for baleloaders mp
Browse files Browse the repository at this point in the history
  • Loading branch information
schwiti6190 committed Mar 26, 2022
1 parent 7de298c commit 8ad1555
Showing 1 changed file with 4 additions and 16 deletions.
20 changes: 4 additions & 16 deletions scripts/ai/controllers/BaleLoaderController.lua
Original file line number Diff line number Diff line change
Expand Up @@ -76,20 +76,8 @@ function BaleLoaderController:isFuelSaveAllowed()
return false
end

BaleLoader.onAIImplementStart = Utils.overwrittenFunction(BaleLoader.onAIImplementStart,
function(self, superFunc)
if superFunc ~= nil then superFunc(self) end
if not g_server then
return
end
self:doStateChange(BaleLoader.CHANGE_MOVE_TO_WORK);
end)

local baleLoaderRegisterEventListeners = function(vehicleType)
print('## Courseplay: Registering event listeners for bale loader')
SpecializationUtil.registerEventListener(vehicleType, "onAIImplementStart", BaleLoader)
function BaleLoaderController:onStart()
if not self.baleLoaderSpec.isInWorkPosition then
self.baleLoader:doStateChange(BaleLoader.CHANGE_BUTTON_WORK_TRANSPORT)
end
end

print('## Courseplay: Appending event listener for bale loaders')
BaleLoader.registerEventListeners = Utils.appendedFunction(BaleLoader.registerEventListeners, baleLoaderRegisterEventListeners)

0 comments on commit 8ad1555

Please sign in to comment.