addSafeHouse doesn't work for more than 1 safehouse claim
0

2 posts in this topic

Recommended Posts

Hello, after the last patch (40.40+) SafeHouse.addSafeHouse (ISWorldObjectContextMenu.lua) works only for the first safehouse claim, so player/admin can capture only the single one safehouse.
Before that patch if you disable that limit with some simple lua. changes, player/admin can capture more than one safehouse. For example change ISWorldObjectContextMenu.lua:

    if not safehouse and clickedSquare:getBuilding() and clickedSquare:getBuilding():getDef() then
        local reason = SafeHouse.canBeSafehouse(clickedSquare, playerObj);
        if reason then
            local option = context:addOption(getText("ContextMenu_SafehouseClaim"), worldobjects, ISWorldObjectContextMenu.onTakeSafeHouse, clickedSquare, player);
            if not (getPlayer():getAccessLevel() == "Admin") and reason ~= "" then
                local toolTip = ISToolTip:new();
                toolTip:initialise();
                toolTip:setVisible(false);
                toolTip.description = reason;
                option.notAvailable = true;
                option.toolTip = toolTip;
            end
        end
    end

I have added

not (getPlayer():getAccessLevel() == "Admin")

it allows admin capture more than 1 safehouse.

Now i can't capture more than one safehouse even if i exceed this limit with lua, "Claim Safehouse" option is available and clickable, but when i click it nothing happens.
Can anyone help me to solve this problem, please?

Edited by Sanchez

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
0