Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change maxPickableObjectMass to maxPickableMass #7

Closed
wants to merge 1 commit into from

Conversation

Marthyn
Copy link

@Marthyn Marthyn commented Oct 26, 2022

FS22 1.8.1 update changed the variable that is checked against when seeing if object is available for pickup. See scripts/PlayerStatePickup.lua#31 when extracting SDK from 1.8.1

Fixes #6

--- scripts/PlayerStatePickup.lua#31
-- @return bool true if player can idle
function PlayerStatePickup:isAvailable()
    if self.player.isClient and self.player.isEntered and not self.player:hasHandtoolEquipped() then
        if not self.player.isCarryingObject and self.player.isObjectInRange then
            if self.player.lastFoundObjectMass <= self.player.maxPickableMass then
                return true
            else
                g_currentMission:addExtraPrintText(g_i18n:getText("warning_objectTooHeavy"))
            end
        end
    end
    return false
end

FS22 1.8.1 update changed the variable that is checked against when seeing if object is available for pickup. See scripts/PlayerStatePickup.lua#31 when extracting SDK from 1.8.1
@Marthyn
Copy link
Author

Marthyn commented Oct 26, 2022

It might also be that this is just a bug in the update and maxPickableMass should in some way inherit from maxPickableObjectMass. But anyways this change will allow for picking up heavy objects like tractors or bales.

if self.maxPickableObjectMass ~= nil then
Player.MAX_PICKABLE_OBJECT_MASS = self.maxPickableObjectMass
if self.maxPickableMass ~= nil then
Player.MAX_PICKABLE_OBJECT_MASS = self.maxPickableMass
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reading through my own changes maybe these are incorrect. But I do not play multiplayer so it's harder for me to test. If they really changed the name of this then i'd expect Player.MAX_PICKABLE_OBJECT_MASS to also have changed to Player.MAX_PICKABLE_MASS

@loki79uk
Copy link
Owner

Hi - thanks for the heads up, I have only just got back from work. I think that I managed to fix it using the same string replacements, and was able to remove a few functions as well. I'll submit to GIANTS now.

@loki79uk loki79uk closed this Oct 26, 2022
@Marthyn
Copy link
Author

Marthyn commented Oct 26, 2022

No problem, thanks for releasing a version 😌

@DarkDoldier
Copy link

Hi @loki79uk do you have a finished fixed version to download?

@DarkDoldier
Copy link

Nevermind i got it lol

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Super strength doesn't work anymore with patch 1.8.1.0
3 participants